I would like to create a macro that will compare "Date Out Requested" entered in a control on frmReservations to DateOut and DateIn in tblReservations.
Can I do this in a macro so that it automatically checks if there is an overlapping reservation? I can do it with a query, but the no-it-all bosses want it done automagically in the background.
This is the macro I have set up that isnt working:
If [Forms]![frmReservations]![DateOutReq] Between [tblReservations]![DateOut] And [tblReservations]![DateIn] then
It gives me an error:
"You may have specified a control that wasn't on the current object without specifying the correct form or report context"
Is the problem that you can't compare form data to data that is already existing in a table?
Thanks!
Can I do this in a macro so that it automatically checks if there is an overlapping reservation? I can do it with a query, but the no-it-all bosses want it done automagically in the background.
This is the macro I have set up that isnt working:
If [Forms]![frmReservations]![DateOutReq] Between [tblReservations]![DateOut] And [tblReservations]![DateIn] then
It gives me an error:
"You may have specified a control that wasn't on the current object without specifying the correct form or report context"
Is the problem that you can't compare form data to data that is already existing in a table?
Thanks!