List Box Multiple clicking

N

neenmarie

I want the user to only click a list box once. But, it requires multiple
clicks before it fills in the required info.

This form is for receiving Raw and/or the Return of Out-Processed Mateiral.
There is a master form with a subform with 3 list boxes.

The first list box has open purchase orders and is re-queried by the vendor
# entered on the master form. Once you click on a purchase order in the
first listbox it fills in the PO number/PN onto the subform and sets focus to
the quantity field on the subform. When the quantity field gets focus it
requeries both the 2nd & 3rd list boxes.

2Nd List box: Shipments sent to outprocesss vendors with shipper numbers
and balance left at vendor. When clicked, fills in the outgoing shipper
number to receive against. (keeps balance left at out-processor for each out
going shipper)

3rd List box: Open releases against blanket raw material POs with quanties
due and due dates. (keeps balance left for each date dute)

The problem I'm having is when clicking on the 2nd or 3rd list box, the user
has to click multiple times to get the data to fill-in. If they aren't
paying close attention, they may move on thinking the data filled in when it
didn't.
 
H

HC

Just a quick suggesstion. Why don't you requery on the enter property
for 2nd and 3nd list box ? Put the code below in the enter property

Dim ctllstbox As Control
Set ctllstbox = Me![Listbox1]
DoCmd.Requery ctllstbox.Name

Set ctllstbox = Me![Listbox2]
DoCmd.Requery ctllstbox.Name

If you want the user only click one, you may chance the property of the
listbox on the code. Hope it help and sorry if i'm misleading your
question.
 
N

neenmarie

Thank you for your response...I'm still a little confused

Also, In the code I don't understand what the "ctllstbox.Name" means. What
do I put in "Name" and what will this do?

Thank you
 
N

neenmarie

The re-query is working fine....it appears to be a focus problem. The user
needs to click on the list box at least once to set the focus there and then
again to click & choose one of the lines. I'm trying to do an If/then
statement, but can't get it right. Can you help me with this statement?

If Me.List86 Is Null Then Me.List93.SetFocus
Else Me.List86.SetFocus
End If

neenmarie said:
Thank you for your response...I'm still a little confused

Also, In the code I don't understand what the "ctllstbox.Name" means. What
do I put in "Name" and what will this do?

Thank you

HC said:
Just a quick suggesstion. Why don't you requery on the enter property
for 2nd and 3nd list box ? Put the code below in the enter property

Dim ctllstbox As Control
Set ctllstbox = Me![Listbox1]
DoCmd.Requery ctllstbox.Name

Set ctllstbox = Me![Listbox2]
DoCmd.Requery ctllstbox.Name

If you want the user only click one, you may chance the property of the
listbox on the code. Hope it help and sorry if i'm misleading your
question.
 
H

HC

ctllstbox.Name is the name of your listbox. It will stay the same for
this line. The one above you will have to chance your listbox name
which i'm naming listbox1 and listbox2. Hope i did clear out some
confusing.
 
H

HC

ctllstbox.Name is the name of your listbox. It will stay the same for
this line. The one above you will have to chance your listbox name
which i'm naming listbox1 and listbox2. Hope i did clear out some
confusing.
 
H

HC

ctllstbox.Name is the name of your listbox. It will stay the same for
this line. The one above you will have to chance your listbox name
which i'm naming listbox1 and listbox2. Hope i did clear out some
confusing.
 
H

HC

ctllstbox.Name is the name of your listbox. It will stay the same for
this line. The one above you will have to chance your listbox name
which i'm naming listbox1 and listbox2. Hope i did clear out some
confusing.
 
H

HC

ctllstbox.Name is the name of your listbox. It will stay the same for
this line. The one above you will have to chance your listbox name
which i'm naming listbox1 and listbox2. Hope i did clear out some
confusing.
 
H

HC

try this....

If Me!List86 > "" then
Me!List86.SetFocus
Else ' This one should take care if the field is null or empty
Me!list93.SetFocus
End If
 
Top