Please help (Listbox DblClicks)

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
 
S

strive4peace

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

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
D

d9pierce

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
 
D

d9pierce

I may add, this listbox is bound to column 2 also if that helps?
Thanks again
Dave
 
S

strive4peace

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top