pi********@hotmail.com skrev:
You do realize that we can't see the structure of your tables, right?
Well, we could if you'd move a little... Based on the information
provided, my guess is that you need to outer join the two tables
TimeSlots and Appointments or whatever. (All records from time
Slots)...
Structure: TimeSlots->Appointments
Query in code (Form_Open):
With Me!lstTimeEnter
..RowSource = ""
..BoundColumn = 1
..ColumnCount = 6
..ColumnWidths = "0cm;0cm;5cm;2,25cm;2,25cm;1,75cm"
..ColumnHeads = True
..RowSource = "SELECT tblApp.AppID, tblCust.CustID, tblCust.Name,
tblEmployee.Initials, tblApp.MyDate, tblTime.Time " _
& "FROM tblCust " _
& "INNER JOIN (tblEmployee INNER JOIN (tblTime INNER JOIN tblApp ON
tblTime.TimeID = tblApp.TidID) ON tblEmployee.EmployeeID =
tblApp.EmployeeID)
ON tblCust.CustID = tblApp.CustID " _
& "WHERE tblApp.MyDate = Forms!APP!MyCalendar " _
& "ORDER BY tblApp.TimeID;"
End With
TimeSlots contains all times from 06:00 up to 16:00 with 30 minutes
steps like:
06:00
06:30 and so on.
I could, maybe, have a default value of some text e.g.: 'FREE' and then
try a query to fill the listbox. Problem is that access only returns
records with values and not the empty records. However...I'll try and
experiment with your suggestion :-)