W
Widemonk
I have a small table and associated form with just 1 field that contains the
8 bank (public) holidays throughout the year (each as a separate record) and
I want to compare all these records against another field in a form where
people enter their holiday (vacation) dates.
The following code only works with the message box. If i delete the message
box line or even move it to within the IF function, it seems the IF function
doesnt execute.
____________
DoCmd.OpenForm "BankHols", acNormal, , , acFormReadOnly
DoCmd.GoToRecord , , acFirst
Do
MsgBox "Test messagebox"
If [Forms]![formholidays]![txtStartHol] =
[Forms]![bankhols]![txtBankHolidayDate] Then
MsgBox "Holiday Cannot start on a bank holiday"
DoCmd.Close acForm, "bankhols", acSaveNo
Exit Sub
End If
DoCmd.RunCommand (acCmdRecordsGoToNext)
Loop Until ...... [all 8 records checked]
DoCmd.Close acForm, "bankhols", acSaveNo
____________
Any ideas please ??
8 bank (public) holidays throughout the year (each as a separate record) and
I want to compare all these records against another field in a form where
people enter their holiday (vacation) dates.
The following code only works with the message box. If i delete the message
box line or even move it to within the IF function, it seems the IF function
doesnt execute.
____________
DoCmd.OpenForm "BankHols", acNormal, , , acFormReadOnly
DoCmd.GoToRecord , , acFirst
Do
MsgBox "Test messagebox"
If [Forms]![formholidays]![txtStartHol] =
[Forms]![bankhols]![txtBankHolidayDate] Then
MsgBox "Holiday Cannot start on a bank holiday"
DoCmd.Close acForm, "bankhols", acSaveNo
Exit Sub
End If
DoCmd.RunCommand (acCmdRecordsGoToNext)
Loop Until ...... [all 8 records checked]
DoCmd.Close acForm, "bankhols", acSaveNo
____________
Any ideas please ??