ConfusedA's Question of the Day... Separating Data from a table into a list box.

ConfusedA

Registered User.
Local time
Today, 18:37
Joined
Jun 15, 2009
Messages
101
Hi there,
I have a set of forms for employee time sheet information. In one form data about employee burdens (vacation, sick days, etc.) is entered. This information is only pertinent for full-time employees.

My problem: my list box takes the 'employeename' field from a table to populate itself, on that table there is a field 'full or part-time' which can have the possible data of 'Full Time' or 'Part Time'.

What Im trying to do(aka why this is a problem): I want to be able to isolate all the full-time employees and place them on the list box (without listing the part time employees).

What I think this involves: Some sort of if or 'iif' statement. I'm just unsure of where to put it, and if my syntax is correct.

My guesses:
IIF ([Full or Part-Time] = "Full Time", [Employeename], (something to not include false options))

If [Full or Part-Time] = "Full Time" Then
(insert something to make this add to the listbox).[Employeename]
End If

Thanks in Advance.
ConfusedA
 
If you are using a list box, you have to have a row source. For the row source, put in a WHERE clause that only displays the full time employees.

ie: WHERE ((([TableName].[Full or Part Time])="Full Time"));
 
Thanks for your quick response.

OK so my list box currently has
Name: Employeename
Control Source: Employeename
Row Source type: Table/Query
Row Source: TblEmployeeinfo

You're saying:
Row Source: WHERE ((([tblEmployeeinfo].[Full or Part Time])="Full Time"));


I tried this and recieved the feedback: The Record Source 'Where(...)' specified on this form or report doesn't exist.
Am I misunderstanding your solution? Perhaps I'm putting this is the wrong spot or require something to specify that employeename must be put in?

Thanks again for your response. I'm not sure if it makes a difference but I'm using Access 2003.
 
Your row source should be

"Select Fields From Table Where Field = x"
 
What you want to do is use a query as your row source, not the actual table. In the properties of the listbox, click on the button with the three dots in the row source field. That will invoke the query builder.

From there, add the TblEmployeeinfo. Select the fields you wish to use. In the criteria line for the field for the part time/full time, put in "Full Time" (I am assuming that is what is stored in the field for the Full Time employees)
 
Ok I got it, Thanks to you both for your help! You're both amazing!
 

Users who are viewing this thread

Back
Top Bottom