L
lee_cufc via AccessMonster.com
Hi,
I am stuck with the following part of my system code:
Set rs = Me.Recordset.Clone
[Time Of Appointment] = Dates.TimeOfBooking
[Date Of Appointment] = Dates.DateOfBooking
rs.FindFirst Format([Time Of Appointment], "hh:mm") & Format([Date Of
Appointment], "mm\/dd\/yyyy") & "#"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch = True Then
DoCmd.GoToRecord , , acNewRec
Basically, 'Dates.TimeOfBooking' and 'Dates.DateOfBooking' are global
variables which hold the 2 values i need. when this form is opened i want it
to search for the record which has a match on the 'Date Of Appointment' and
'Time Of Appointment' fields with those values held in the global variables
as mentioned above.
So far this code adds new record correctly however returns a sytax error
which reads 'missing operator in expression' i am pretty uncertain on how to
set the format for searching for date and time values so i guess this is
where i am going wrong?
many thanks in advance, any help is most welcome.
Lee
I am stuck with the following part of my system code:
Set rs = Me.Recordset.Clone
[Time Of Appointment] = Dates.TimeOfBooking
[Date Of Appointment] = Dates.DateOfBooking
rs.FindFirst Format([Time Of Appointment], "hh:mm") & Format([Date Of
Appointment], "mm\/dd\/yyyy") & "#"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If rs.NoMatch = True Then
DoCmd.GoToRecord , , acNewRec
Basically, 'Dates.TimeOfBooking' and 'Dates.DateOfBooking' are global
variables which hold the 2 values i need. when this form is opened i want it
to search for the record which has a match on the 'Date Of Appointment' and
'Time Of Appointment' fields with those values held in the global variables
as mentioned above.
So far this code adds new record correctly however returns a sytax error
which reads 'missing operator in expression' i am pretty uncertain on how to
set the format for searching for date and time values so i guess this is
where i am going wrong?
many thanks in advance, any help is most welcome.
Lee