Hello Everyone
I am trying to do a if statement in a loop.
Below is the code.
Code:
Private Sub Monday_Click()
Dim LResponse As Integer
Dim a As Integer
For a = 1 To 5
If Text284 = DLookup("[HolidayDate]", "Holiday_T", "HolidayDate = #" & Format(Nz(Forms!Create_New_Entry_F!Text284, 0), "Short Date") & "#") 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.Locked = True
End If
End If
Next a
End Sub
I am trying to restrict "Monday" text box depending on the value of the "Text284" textbox.
If the user clicks yes, "Monday" textbox is focused and it is editable.
If no, its locked.
and this goes on a loop. If the user clicks the "Monday" text box again.
I am not sure how to change the code to make it work.
Can anyone help me with this.