Limit list

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

I have a form hour registration on witch i have a field employee and hour
type.

In the table employee i have a field full-time or part-time employee.

In the table hour type i have a field full-time and part-time. So a hour
type is either ment for a full-time or parttimer or both.

On choosing the hour type in my hour registration i want to limit the list
to the hour types of the employee bing full or parttimer.

So in the hour registration a choose a employee and moving the hour type
input field the dropdown should limit the list to either parttimer of
fulltimer hour type bases on the employee being full- or parttimer.

Can this be done and how?

Thans for any tips.

Regards,

Harmannus

tblHour
HourID
EmployeeID
HourtypeID (limit to full-timer of part-timer based on employeeID)

tblEmployee
EmployeeID
Name
choose Full-timer or Part-timer

HourtypeID
Hour (Holiday, overtime etc)
choose Full-timer of parttimer
 
After you've chosen the hour type, create an SQL string that represents what
you want included in your employee list and use that string to reset the
RowSource property of your list.

strSQL = "SELECT EmployeeID, EmployeeNm "
strSQL = strSQL & "FROM Employees"
strSQL = strSQL & "WHERE EmployeeType = " & <whatever>
Me!lstEmployees.RowSourceType = "Table/Query"
Me!lstEmployees.RowSource = strSQL
 
Back
Top