Im trying to get this VBA code to work so if the SQL returns a count of 1 or more then the msgbox will appear and the user cannot add the date and time. This is to stop conflicts of booking 2 interviews on the same date and time:
Expand|Select|Wrap|Line Numbers
- Public Sub Interview_Time_AfterUpdate()
- Dim strSQL As String
- strSQL = "SELECT Count(*) from tblIntCandInterview WHERE [Interview Date] = '" & Me.Interview_Date & "' and [Interview Time] = '" & Me.Interview_Time & "'"
- If strSQL > 0 Then
- MsgBox "Interview Date & Time Conflicts With Another, Please Change Date or Time!"
- Else
- MsgBox "Date & Time of Interview OK"
- End Sub
Thanks, Charlie