run query from a listbox that updates a form

chewy

SuperNintendo Chalmers
Local time
Today, 20:47
Joined
Mar 8, 2002
Messages
581
I am kind of lost on this. I have a list box with employee names and when it is clicked I want to run a query with only that employees information in it. From frmMain I have the list box which is read from tblEmployees. I then want it to run from qryEmployee and update frmVacation with the queried information. I cant figure where to begin this mess.

Thanks for any help!
 

Attachments

anybody have any ideas?
 
Pat you dont have any design ideas?
 
I would build the form on the query and take out
Id and Name and instead of using list box
combo boxes sometimes are easier to work with
I have been working on this but dont have it
worked out will try again in a hour
 
thanks, any help will be appreciated on this one!
 
chewy,

I took a peek at it.

The OnClick on the listbox should just do a:

Me.frmVacation.Requery

The problem is that you needed a Query, not base the form on
the table. I took out the child links, made a query where the
criteria for EmployeeID was Forms![frmMain]![lstEmployee].
That gets the appropriate records. Things are in synch.
But now I have to get their name and right reason code.

I'll be in touch.

Wayne
 
it works for the first name but not any other...it just takes out all but the first record
 
just got it to work but I have a long way to go!
 
chewy,

Boy, its been a long day.

What was bothering me, was how to get the Reasons,
Emp Names, etc to display for every record, not just the current
one.

The way to do that is for the query that frmVacation is bound
upon, just add the other tables in in design view and every
thing relates just fine.

Let me know.

hth,
Wayne
 
not sure what your getting at.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom