By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,398 Members | 1,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,398 IT Pros & Developers. It's quick & easy.

Question on listbox and opening form

P: n/a
Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Depending on structure, you can cerainly do this. You would have an employee
form bound to an employee table. The list box would have a column for the
record id of the employee records and the employee names. If you set the
bound column of the list box to the record id of the employee records and
then you can reference the value of that control in your openform statement.

In the doubleclick event of the list box, run the docmd.openform and pass
the record id as a criteria...

DoCmd.OpenForm "frmEmployee", , , "emp_no = " & Me.lstEmployees

hth
Chris
"Daniel Hidalgo" <hd*****@hotmail.com> wrote in message
news:ea*************************@posting.google.co m...
Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo

Nov 12 '05 #2

P: n/a
hd*****@hotmail.com (Daniel Hidalgo) wrote in message news:<ea*************************@posting.google.c om>...
Hi,

I have an issue that I am trying to resolve. I am populating a list
box with employee names and would like to have the capability for a
user to open an employee record by double clicking on the emplpoyee
name in the listbox. Is this possible to do?

Thanks,

Daniel Hidalgo


Except you can't use the Multi-Select option of the listbox if you
want to do this. If you did, you would have to loop through the
ItemsSelected collection of the listbox and create a valid WHERE
statement that you could pass to the form you would be opening. You
can get code for it at www.mvps.org
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.