Please help (Listbox DblClicks)

  • Thread starter Thread starter d9pierce
  • Start date Start date
D

d9pierce

Hi all,

I need some help with a listbox dblclick function.

I have a form (Frm_Company) and it has a ListBox on it that relates to
contacts. This list box is populated by a Query with data from another
form, "related to this form (Frm_Company by a combobox", I have tried
many samples and none seam to work like specified. I am trying to
dblclick on a row in my list box to open the form (Frm_Contacts) to
that recordID to view other details not included in this listbox or
edit information.

I can get the form to open but shows all records and other methods I
have used give me missing operators issues like ContactID = ContactID?

My list box currently includes:
0' ContactID
1'CompanyID
2' ContactTypeID
3' Contact Type
4' Contact
5' Phone
6' Ext
7' Fax
8' Email

Does anyone have an example of code used to do the dblclick function?

Please advise and thank you in advance!

Dave
 
docmd.openform "Frm_Contacts",,, _
"ContactID = " = me.listbox_controlname

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Hi Crystal,
That worked great with exception to one issue! It only opens form to
all records, not the specific record I click on, Any other suggestions?
Thanks
Dave
 
then you need to specify the column with the ID field...

docmd.openform "Frm_Contacts",,, _
"ContactID = " = me.listbox_controlname.column(0)

column indexing starts with 0

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Back
Top