The code is a simple If statement with the first line involving both a DLookup for date validation and a second part checking if a field is locked (I've also tried enabled).
If I understand you correctly, you want:
If
[Days] = [EndDate]
And
Your_TextBox is Locked
Then
Do Something?
Else
Exit Sub
Is that correct?
If so . . .
Will something like this work for you?
Code:
If DLookup("Days", "tblDailyReport", "[Days] = #" & [End Date] & "#") Then
If Me.TextBoxName.Locked Then
'Do Something
End If
Else
MsgBox "No report with that End Date has been filled out."
Exit Sub
End If