G
Guest
Hi All,
Why do I get this message RUN TIME ERROR 3061; TOO FEW PARAMETERS, EXPECTED 1?
This is the code:
Dim Bookable As Boolean
Dim strSQL As String
strSQL = "SELECT Query1.*, Query1.DateBooked FROM Query1 WHERE
(((Query1.DateBooked)=[forms]![Booking]![DateTB]));"
'For Each record In CurrentDb.OpenRecordset(strSQL)
Dim YahooTest As DAO.Database
Dim RSBooking As DAO.Recordset
Set YahooTest = CurrentDb
Set RSBooking = YahooTest.OpenRecordset(strSQL)
Do While Not RSBooking.EOF
If [Start Time] < StartTime Then
If [End Time] < StartTime Then
Bookable = True
MsgBox "Bookable"
Else
Bookable = False
MsgBox "Unbookable"
End If
End If
Loop
It appears my code stops just before the beginning of my Do While loop.
Please let me know what the mistake is.
Why do I get this message RUN TIME ERROR 3061; TOO FEW PARAMETERS, EXPECTED 1?
This is the code:
Dim Bookable As Boolean
Dim strSQL As String
strSQL = "SELECT Query1.*, Query1.DateBooked FROM Query1 WHERE
(((Query1.DateBooked)=[forms]![Booking]![DateTB]));"
'For Each record In CurrentDb.OpenRecordset(strSQL)
Dim YahooTest As DAO.Database
Dim RSBooking As DAO.Recordset
Set YahooTest = CurrentDb
Set RSBooking = YahooTest.OpenRecordset(strSQL)
Do While Not RSBooking.EOF
If [Start Time] < StartTime Then
If [End Time] < StartTime Then
Bookable = True
MsgBox "Bookable"
Else
Bookable = False
MsgBox "Unbookable"
End If
End If
Loop
It appears my code stops just before the beginning of my Do While loop.
Please let me know what the mistake is.