- If Not IsNull(Me.FirstDate) and Not IsNull(Me.SecondDate) Then
-
If DateDiff("d", Me.FirstDate, Me.SecondDate) > 4 Then
-
MsgBox "It's been more than 4 days !"
-
End If
-
End If
-
You don't say when you want this message to popup. If you want it to popup after entering one of these dates, place it in the AfterUpDate event for the textbox. If you want it to popup when moving to a record, place it in the Form_Current event.
Welcome to TheScripts!
Linq ;0)>
Hey, Thanks for the bit of code. I'm still having problems and feeling abit like an idiot at the moment.
This is what I have got at the moment:
Private Sub Site_Survey_Date_A(Form_Current)
If Not IsNull(Me.Site_Survey_Date_A) And Not IsNull(Me.G_A_Completion_Date_A) Then
If DateDiff("d", Me.Site_Survey_Date_A, Me.G_A_Completion_Date_A) > 4 Then
MsgBox "It's been more than 4 days !"
End If
End If
End Sub
Which probably is totally wrong, but I'm getting nothing, and I haven't a clue what I'm doing really. Should the code go into section for the actual field or for the general form or what? I'm sorry but as I said before I'm kinda clueless.
I think I have explained it wrong also. I believe what I need instead of what I originally described is:
If there hasn't been a date inputted in since the date inputted in the other field then it should warn me.
I've only just realised what I've said. Sorry about that.