I swear this worked when I tried it a couple of days ago... now suddenly it doesn't
It's not doing the bit in bold, checking the date entered is greater than the date in txtDateReg.
Dim FindPatients As Range
Set FindPatients = myPatients.Find(what:=cboPatients, lookat:=xlWhole)
txtDateReg.Value = FindPatients.Offset(0, 3)
txtDateReg.Enabled = True
myDate = InputBox("Enter the Patient Admitted Date", "Date Entry", Date)
If myDate <> "" Then
Do Until IsDate(myDate)
If IsDate(myDate) = False Then
MsgBox "Date is not entered"
myDate = InputBox("Enter the Patient Admitted Date", "Date Entry", Date)
If myDate < txtDateReg.Value Then
Do Until myDate > txtDateReg.Value
MsgBox "Registered Date is after admitted date!"
myDate = InputBox("Enter the Patient Admitted Date", "Date Entry", Date)
Loop
End If
End If
Loop
End If
Bookmarks