Listbox Question

da poet

Registered User.
Local time
Today, 12:22
Joined
Aug 23, 2004
Messages
39
I seem to be having some listbox troubles. I would like to know how to use the highlighted record that i have selected in my listbox to update another field on my form.

I had used a macro with the event on dblclick, the problem is the event seems to be carrying out the update on all the elements in the listbox instead of the highlighted one. Please advise
 
Last edited:
I have used this from a pop-up with a find in it and with you click the item in the hi-lited column it puts that item into the txbox. If that is what you are trying to do try something like:
If SysCmd(acSysCmdGetObjectState, ACForm, "FormName") Then
Forms("FormName")("SubFormName if Needed")("PartNo").Value = Me("part_number").Value
DoCmd.Close ACForm, "Pop-up form"
End If
Make the substitutions and you should be close. hth.
 
da poet said:
I seem to be having some listbox troubles. I would like to know how to use the highlighted record that i have selected in my listbox to update another field on my form.

I had used a macro with the event on dblclick, the problem is the event seems to be carrying out the update on all the elements in the listbox instead of the highlighted one. Please advise

Listboxes can be kinda of funky. If you use the scrollbars to highlight an item in the list that item is not selected until you click on it. That could be your problem.
 
Check out the AfterUpdate help file for the listbox. It works pretty much the same for the combo box, as well.
 

Users who are viewing this thread

Back
Top Bottom