I have a table which just lists time slots. Every 15 mins from 9:00am - 5:00pm. The format of [Time] in TBTime is 'Medium Time'.
e.g. TBTime
TimeID___Time
___1_____9:00am
___2_____9:15am
___3_____9:30am
I want to Dlookup the [TimeID] based on the [Time].
When I used the code:
Bazaarly this will result in a null answer unless the time is dividable by 3, i.e. if the time is 3:00am,6:00am,9 :00am or 12:00am the Dlookup statement works, otherwise it gives in a null result.
I tried putting the TBtime into a query using 'FormatedDate: Cdate([Time])' and changing the code to:
But this didn't make any difference. I don't understand what is happening and I don't know what else to try, any ideas would be greatly appreciated.
e.g. TBTime
TimeID___Time
___1_____9:00am
___2_____9:15am
___3_____9:30am
I want to Dlookup the [TimeID] based on the [Time].
When I used the code:
Code:
DLookup("[TimeID]", "TBTime", "[Time] = #" & Me.NextAvaliablePickupTime & "#")
I tried putting the TBtime into a query using 'FormatedDate: Cdate([Time])' and changing the code to:
Code:
DLookup "[TimeID]", "QYFormatedTime", "[FormatedTime] = #" & Me.NextAvaliablePickupTime & "#")
Comment