list box help

netuse@debouck.

Registered User.
Local time
Today, 10:11
Joined
Jun 27, 2004
Messages
37
i have a form with a list box call it list1 populated by a query with a field loc# with a dbl click event that opens aother form with another list box (list2)that i want to use the loc# from previous list box(list1) along with the query for current list box(list2) to populate list2

list1 query based on a residents table
list2 query based on a guest table

both use loc# to link

any help would be gretly appreciated
 
netuse,

The query for the second ListBox should refer to the loc# as:

Forms![YourMainForm]![YourListBox]

Wayne
 
ok thanks wayne it worked great another ? for the master. the first list box opens i select a resident it opens the other list box but i want the first one to close automatically i tried the after update but it closes if i move to a different record which now makes sense so what event do i use?
 
Net,

What do mean by close? Make it invisible?

Don't understand.

Wayne
 
here we go. i have a form with a list box that on keyascii return it needs to check the expire date which is a column in the list box and if that date is today or a future date go to another form to enter in the gate log if it is before today go to a contact resident form. i have been trying to figure out with if else but i am at a stand still.

any help would be appreciated
 
net,

Don't know about "key Ascii return", but how about AfterUpdate:

Code:
If  Me.YourListBox.Column(n) < Date Then
   '
   ' Do your code
   '
End If

Columns start at 0!

Your second column is 1!

Wayne
 
wayne,

when i put the code on the afterupdate everytime i move to another record it opens the form i need to be able to move through records choose the correct one hit enter key and have it check to see if the expire date has expired or not then open the the correct form.
 
Brock,

I need more info here.

Is your listbox "bound" to your table? You said a query.

I'm getting way confused here.

Wayne
 
ok


this is the flow

i have a form that user puts in last name that brings up a form with a list box on it with a list of resident names they can choose from they choose a name hit enter key it brings up another form with an unbound list box which lists the guests for that resident this is where it gets tricky. i need to be able to select the correct guest and if the guests expire date is still current then go to anothre form that adds them to a gate log table. if its not current go to a contact resident form. also i have it set up on key press event for keyascii return
 
Last edited:
Brock,

Forget the ASCII Return.

What's the RowSource of the last listbox? Why not base it on a query
and for the Guest's expire date, set it to >= Date().

Then your list box will only display "valid" guests.

Wayne
 
wayne,

it is based on a query but i need to show all the guests so if the guest is on the list but expired and the resident clears them i can just update the guest
the guest# of the guest will be passed to the contact resident form which will have a button to another form to update that guests record. after update will go to the gate log enter form

and how do i use the enter key to select the record in not the keypress event
 
Brock,

I have to go eat dinner. The AfterUpdate key is the event for after
the user chooses the guest. If there is no decision to be made, even
if they're expired, then the ContactForm can be opened and it can
reference the potential guest by:

Forms![GuestForm]![YourListBox]

Will check in later.

Can you post a sample? This is hard to visualize.

Wayne
 
I think I kind of see what you're looking for, but as another option, why don't you use the doubleclick event instead of trying to create a key down or key press event that is sensitive to the Enter key? Or add a command button that they can click that will reference the respective guest identifier in the listbox?

You, theoretically, could add a key down or key up event to capture the enter key, but it would seem to be more hassle than it's worth - is there a reason you're driven to use the enter key as opposed to the doubleclick event or a command button?
 
econ,

the reason for the keypress event is that it needs to be keyboard driven as much as possible.


here is sample. thanks in advance
 

Attachments

Last edited:
if anyone could take a look at this thread and look at my sample and give any suggestions it would really be appreciated
 
Hi Brock,

Looked at your DB. Your relationships definitely show that the app revolves
around the members. OK.

But, I have no idea how the forms should flow. I saw th form GListSelect
which is a list of guests, but what should it do?

Need some guidance here.

Wayne
 
ok the flow is as follows

frmEnterName
then
frmGlogLastName
then
frmGlistSelect
when they get to guest list i wanted to select guest if guest expire date is expired then go to a contact resident for which displays resident phone #'s whith a button to open a edit form linked to that guest# after edit go to frmGateLogEnter. or if guest not on list hit esc key go to contact resident form and button to add new guest and then frmGatelogEnter.

i also have to be able to do this with resident address

but dont know how without making duplicates of everything for name a changing it around

is it possible to use same queries for both

for address it just brings up address list first that links to resident name last from above but the way its set up its needs the input from form frmEnterName

thanks in advance you have been a big help
 
Brock,

Let's concentrate on frmGLogLastName.

You successfully trap for the Escape key and close the form, that's good.

But on the ListBox, when they hit enter, you have no way of knowing which
member they have chosen. They are going to have to use the mouse.

You can use the double-click event.

Why the emphasis on only using the keyboard?

Also, it would be nice to have the whole process defined in words.

1) Guest comes up and provides member name
2) If member doesn't exist ...
3) If guest doesn't exist ...
4) If guest exists, but is expired ...

I really see this running as a central screen with a member listbox.
When a member is selected, a combo-box could display potential guests.

Currently, it seems like too many forms.

Wayne
 

Users who are viewing this thread

Back
Top Bottom