Marcster
06-21-2012, 11:24 AM
Hi People,
Having trouble trying to do something which is probably easy for someone, been a long time since I developed in Access.
I have a table:
Name: Table1
Fields: DateFrom, DateTo
Only 1 record in table.
Using VBA I want to check that a date is or between these two dates.
Sub CheckDate(strDate)
If strDate is or between DateFrom and DateTo then OK, if not display error message and exit sub.
End Sub
Example, if Table1.DateFrom holds 01-Jan-2012 and Table1.DateTo holds 31-Jan-2012
and strDate has a value of 01-Jan-2012, then display message to say strDate OK.
If strDate is 02-Feb-2012 then diplay an error message.
Any one know a way to do this?.... :banghead: .
Thanks.
Having trouble trying to do something which is probably easy for someone, been a long time since I developed in Access.
I have a table:
Name: Table1
Fields: DateFrom, DateTo
Only 1 record in table.
Using VBA I want to check that a date is or between these two dates.
Sub CheckDate(strDate)
If strDate is or between DateFrom and DateTo then OK, if not display error message and exit sub.
End Sub
Example, if Table1.DateFrom holds 01-Jan-2012 and Table1.DateTo holds 31-Jan-2012
and strDate has a value of 01-Jan-2012, then display message to say strDate OK.
If strDate is 02-Feb-2012 then diplay an error message.
Any one know a way to do this?.... :banghead: .
Thanks.