Opening a form when selecting an item in Listbox

  • Thread starter Thread starter Kmsdove
  • Start date Start date
K

Kmsdove

Guest
I am having trouble figuring out how to open a form when selecting an item in a listbox. I have created a variable in VB and tried to use it with the DoCmd.OpenForm. I have used the ItemSelected. Possibly I am missing something has anyone done this?
 
Hi kmsdove!
If I am getting you right , you want to open a Form after when you select an item from a list box.
Is the item selected from the list box ,the name of the form to be opened? If it is ,then what you have to do is put the docmd.openform () statement in the afterupdate event of the list box.
please do reply if its not that what you want.
Regards!
Imran
 
This is what I have...

First Form:

Has List box with a listing of items and the bound column is for example, PartID. The name of the listbox is lstParts. I want to be able to doubleclick on item and open a form with detailed information. I have a DoCmd.OpenForm now however, I can't get it to pass the PartID properly. I tried in the Where condition on the OpenForm using filter. Also, the PartID is I get with the ItemSelected and set a variable with the information to be passed. Its not working for some reason I must be doing something wrong.

I have code for the second form using the doubleclicked event.
The field in the second form that should receive the partID is called PartID.
 

Users who are viewing this thread

Back
Top Bottom