Listbox double click error

chris9104

New member
Local time
Today, 22:46
Joined
Nov 13, 2010
Messages
4
Hi guys, hope you can help

I have a multicolumn list box (lstsundry) which when I double click an entry is supposed to bring up a form (Add Sundry) with the selected records details in it, however it is only bringing up the form ready for a new entry.

The form is bound to the table where the records are, the listbox is unbound.

On properties data entry is set to No. I am using the below code:

Code:
DoCmd.OpenForm "Add Sundry", , , [ID] = "lstsundry.ID =" & Me.lstsundry.Column(0), acFormEdit
 
Try;
Code:
DoCmd.OpenForm "Add Sundry", , , "[ID] = " & Me.lstsundry, acFormEdit
If the column(0) is the column in the list that holds the linking criteria there is no need to explicitly name it.
 
Try;
Code:
DoCmd.OpenForm "Add Sundry", , , "[ID] = " & Me.lstsundry, acFormEdit
If the column(0) is the column in the list that holds the linking criteria there is no need to explicitly name it.


Thank you, worked perfectly
 
A little trick that you can use to get the correct code every time is to use the Button wizard to create a button to do the job, and then copy and paste the code from the button into the Double Click event ;) then simply delete the button once you are done.
 

Users who are viewing this thread

Back
Top Bottom