sam1fletcher
Registered User.
- Local time
- Today, 08:29
- Joined
- Jan 28, 2013
- Messages
- 40
Hey All
got runtime error 3061 which i realised my sql code is wrong
This is meant to open a recordset that the records are between 2 dates from 2 textboxes on a form.
i think the sql is alittle dodgy can anybody see a problem
sam
got runtime error 3061 which i realised my sql code is wrong
Code:
Dim rs As DAO.Recordset
Dim sql As String
Dim ct As Integer
sql = "SELECT * FROM tblBookings WHERE (((tblBookings.Date_Start) Between [Forms]![frmMenu]![ArrivalDate] And [Forms]![frmMenu]![ArrivalDate]+29)) OR (((tblBookings.Date_End) Between [Forms]![frmMenu]![ArrivalDate] And [Forms]![frmMenu]![ArrivalDate]+29));"
Set rs = CurrentDb.OpenRecordset(sql)
With rs
.MoveFirst
.MoveLast
ct = .RecordCount
End With
Me.r11.Value = ct
This is meant to open a recordset that the records are between 2 dates from 2 textboxes on a form.
i think the sql is alittle dodgy can anybody see a problem
sam