Hi all, hope all is well during this Pandemic!
I'm having an issue with an Unbound Form whereby there are two text fields. StartDate and EndDate which are manually filled in by the user before pressing a command button which runs a query, both fields set to short date,
all standard stuff....
However, I want to have some kind of validation when pressing the Command button that the End Date is not earlier than the Start Date. Ive tried
What am I missing?
I'm having an issue with an Unbound Form whereby there are two text fields. StartDate and EndDate which are manually filled in by the user before pressing a command button which runs a query, both fields set to short date,
all standard stuff....
However, I want to have some kind of validation when pressing the Command button that the End Date is not earlier than the Start Date. Ive tried
Code:
Private Sub cmdRequery_Click()
If EndDate > StartDate Then
MsgBox "You must enter an End Date later than the Start Date!", vbOKOnly, "Incorrect End Date"
EndDate.SetFocus
Else
Me.Form.[qry_TransactionBreakdown Subform].Form.Requery
Me.txt_TotalExpenses.Requery
Me.txt_TotalIncome.Requery
End If
End Sub