I have a listbox that displays 19 items when I click the search button. Item 1 is my primary key with item 19 being an attachment. So that would be column(0) and then column(18)
I have a right click option set up for sorting and an edit button so once the user finds the record they want to edit they click the edit button. The entire 1st row in the listbox is highlighted upon open of form.
What I want is if they see an attachment, which will be .pdf or .doc and they are very small and yes I know attachments in DB is not advisable, however this is how the upper folks want it for now until we get our server and of course they all say if Access did not mean for it to be used then why include it in the software programming options........ .....I am not going to argue this point with those that pay me..........wha tever they want I do............. .
So, my problem is, I want an event, maybe a double click would be ok so I can have some sort of query that says ok when the user double clicks and it is on row 8 which would have primary key of 8 and the attachment is there, open that attachment for viewing. Here is what I tried coding for it but it does not do anything other than clear out everything in my listbox.
and tried
I have a right click option set up for sorting and an edit button so once the user finds the record they want to edit they click the edit button. The entire 1st row in the listbox is highlighted upon open of form.
What I want is if they see an attachment, which will be .pdf or .doc and they are very small and yes I know attachments in DB is not advisable, however this is how the upper folks want it for now until we get our server and of course they all say if Access did not mean for it to be used then why include it in the software programming options........ .....I am not going to argue this point with those that pay me..........wha tever they want I do............. .
So, my problem is, I want an event, maybe a double click would be ok so I can have some sort of query that says ok when the user double clicks and it is on row 8 which would have primary key of 8 and the attachment is there, open that attachment for viewing. Here is what I tried coding for it but it does not do anything other than clear out everything in my listbox.
Code:
Private Sub ListQuality_DblClick(Cancel As Integer) DoCmd.OpenTable "main.attachment", acViewNormal, acReadOnly End Sub
Code:
Private Sub ListQuality_DblClick(Cancel As Integer) On Error Resume Next listbox.RowSource = "select main.attachment" & _ "from main " & _ "where main.mstrID = " & listbox.Value * "'";" End Sub
Comment