Darrenc
Registered User.
- Local time
- Today, 13:37
- Joined
- Apr 30, 2004
- Messages
- 62
I'm sure I’m being very dense can someone point out my obvious error?
I'm trying to do a dlookup for a date in a table where the form ID matches the ID in the same table.
Every time i run the code i get "Type Mismatch". I've tried changing variable type, I’ve checked that TraEndDate is actually a date. It all looks like it should work.
The TraStartDate and TraEndDate are in a General Date format because i need the time stamp as well as the date. Is this the source of my problems?
This is really frustrating, i thought this would be very simple to do, as always its the 'simple' things that catch you out.
Regards
Darren
I'm trying to do a dlookup for a date in a table where the form ID matches the ID in the same table.
Code:
Dim dteTimeLower As Date
Dim dteTimeUpper As Date
Dim intCurrentID As Integer
intCurrentID = Forms!frmNewBusinessQuoteForm!QuoteID
dteTimeLower = Nz(DLookup("TraStartDate", "tblStopWatch", "TraQuoteID " = intCurrentID), Now())
dteTimeUpper = Nz(DLookup("TraEndDate", "tblStopWatch", "TraQuoteID " = intCurrentID), Now())
Every time i run the code i get "Type Mismatch". I've tried changing variable type, I’ve checked that TraEndDate is actually a date. It all looks like it should work.
The TraStartDate and TraEndDate are in a General Date format because i need the time stamp as well as the date. Is this the source of my problems?
This is really frustrating, i thought this would be very simple to do, as always its the 'simple' things that catch you out.
Regards
Darren