Kobus-Dippenaar
Registered User.
- Local time
- Tomorrow, 01:11
- Joined
- Oct 10, 2014
- Messages
- 50
Good day to all,
The code I have used before within the program to set the focus is not working. It Goes to the next field.
I have put the code into the Private Sub section using the LEFT FOCUS attribute.
As I click into the next field, thus leaving the date field, the if statement below does come into play, BUT it does not reset the focus to the date field in the form.
Private Sub DBDatelbl_LostFocus()
wstart = DLookup("[Stdstart]", "StockDates", "[Stdid]= 1")
If Me.DBDate <= wstart Then MsgBox "Date must be greater that Start Date": Me.DBDatelbl.SetFocus
End Sub
Your precious insight and wisdom is much appreciated.
Blessings
The code I have used before within the program to set the focus is not working. It Goes to the next field.
I have put the code into the Private Sub section using the LEFT FOCUS attribute.
As I click into the next field, thus leaving the date field, the if statement below does come into play, BUT it does not reset the focus to the date field in the form.
Private Sub DBDatelbl_LostFocus()
wstart = DLookup("[Stdstart]", "StockDates", "[Stdid]= 1")
If Me.DBDate <= wstart Then MsgBox "Date must be greater that Start Date": Me.DBDatelbl.SetFocus
End Sub
Your precious insight and wisdom is much appreciated.
Blessings