Hi,
I have a form with several multi column listboxes, these are populated using a query supplying the top 1 record from a table (based on some criteria).
They work fine but when I added a button (for each list box) to open a detailed form to edit the data from the record I ran into problems.
The add button wizard created the stlink criteria but whenever I tried it I got an error :
Syntax error (missing operator) in query expression '[ID]='
The code generated is
For some reason the ID from the list box, which is the bound column for the list box is not seen by the code, any ideas why?
I have worked around by using another hidden text box (for each listbox)which uses Dlookup to get the ID from the table.
I've tried using list1.column(1) without success...!!!
Any pointers will be much appreciated.
Gadjet
I have a form with several multi column listboxes, these are populated using a query supplying the top 1 record from a table (based on some criteria).
They work fine but when I added a button (for each list box) to open a detailed form to edit the data from the record I ran into problems.
The add button wizard created the stlink criteria but whenever I tried it I got an error :
Syntax error (missing operator) in query expression '[ID]='
The code generated is
Code:
stLinkCriteria = "[ID]=" & Me![List1]
DoCmd.OpenForm stDocName, , , stLinkCriteria
For some reason the ID from the list box, which is the bound column for the list box is not seen by the code, any ideas why?
I have worked around by using another hidden text box (for each listbox)which uses Dlookup to get the ID from the table.
I've tried using list1.column(1) without success...!!!
Any pointers will be much appreciated.
Gadjet