I have the following function that gets time as a parameter in the form of 8:00:00am. I format it to "h:mm" but still continues to be 8:00:00am. The field is formatted as Short Date. I also have a Query where I group together all appointments scdheduled for the same time. I created a DLookup to get the value of how many persons have an apointment in the same time but the system returns the error "Run Time Error 3075". I believe it has something to do with the time value itself but I cannot locate the problem. In the table the time is saved as a short date 08:00 not 08:00:00 am.
Here is the code, any help will be appreciated.
Function FindTime(ATime As Date)
Dim TTime As Date
Dim NTime As Date
TTime = Format(ATime, "h:mm")
NTime = DLookup("Persons", "QSchedule", "ATime =#" & TTime & "#")
And here is where I call the function:
Private Sub Command22_Click()
Dim TTime As Date
TTime = Format("8:00", "h:mm")
FindTime (TTime)
End Sub
Here is the code, any help will be appreciated.
Function FindTime(ATime As Date)
Dim TTime As Date
Dim NTime As Date
TTime = Format(ATime, "h:mm")
NTime = DLookup("Persons", "QSchedule", "ATime =#" & TTime & "#")
And here is where I call the function:
Private Sub Command22_Click()
Dim TTime As Date
TTime = Format("8:00", "h:mm")
FindTime (TTime)
End Sub