I tried the below code:
Code:
Private Sub Monday_AfterUpdate()
Dim LResponse As Integer
If Monday.Value > 0 And Text284 = DLookup("[HolidayDate]", "Holiday_T", "HolidayDate = #" & Format(Nz(Forms!Create_New_Entry_F!Text284, 0), "Short Date") & "#") And Text295 = DLookup("[FIRMS]", "Holiday_T") Then
LResponse = MsgBox("Please note this day is a holiday. Do you still want to charge on this day? ", vbYesNo, "CONTINUE")
If LResponse = vbYes Then
Me.Monday.SetFocus
Else
Me.Monday.Value = 0
End If
End If
End Sub
But its not showing any warning message.
Text295 stores the company name from the employee Table.
I think there is a problem with the Dlookup.
Its not looking up the firm name. How can I change the query?
And the company name is a text and it is same in both the tables.