I have created a table (tblRefWeekSchedule) that corresponds to a Weekly Class Schedule. It contains the fields Weekday(intWeekday) Start Time (dteStartTime), End Time (dteEndTime), Venue and Class.
The table was populated from an Excel spreadsheet and I note that when exporting the table it stores the times as 00/01/1900 09:30:00 etc. etc.
I then have a form to create Class records. Upon entering a Date (tbxDate) and Start Time (tbxStartTime) I am trying to use the DLookup function from the AfterUpdate event on the control tbxStartTime to pre-populate the controls for End Time (tbxEndTime) Venue and Class.
So firstly I have determined the day of the week ...
intDay = Weekday(tbxDate)
I then follow this with the table lookup ...
tbxEndTime = DLookup("[dteEndTime]", "tblRefWeekSchedule", "[intWeekDay] = " & intDay & "'" And "'" & "[dteStartTime] = " & Me.tbxStartTime)
This returns a Type Mismatch (tbxStartTime is 09:30:00)
I have unsuccessfully tried to re-format both dteStartTime and tbxStartTime but finding the appropriate formatting/conversion function and getting my single quotes and double quotes in the correct place has totally confused me.
Your help would be much appreciated
The table was populated from an Excel spreadsheet and I note that when exporting the table it stores the times as 00/01/1900 09:30:00 etc. etc.
I then have a form to create Class records. Upon entering a Date (tbxDate) and Start Time (tbxStartTime) I am trying to use the DLookup function from the AfterUpdate event on the control tbxStartTime to pre-populate the controls for End Time (tbxEndTime) Venue and Class.
So firstly I have determined the day of the week ...
intDay = Weekday(tbxDate)
I then follow this with the table lookup ...
tbxEndTime = DLookup("[dteEndTime]", "tblRefWeekSchedule", "[intWeekDay] = " & intDay & "'" And "'" & "[dteStartTime] = " & Me.tbxStartTime)
This returns a Type Mismatch (tbxStartTime is 09:30:00)
I have unsuccessfully tried to re-format both dteStartTime and tbxStartTime but finding the appropriate formatting/conversion function and getting my single quotes and double quotes in the correct place has totally confused me.
Your help would be much appreciated