dpatfield66
Well-known member
- Joined
- Apr 6, 2006
- Messages
- 136
- Programming Experience
- 5-10
I have a FormatDate() routine that I call on the LostFocus Event for all my dates. If the entry in the control is an invalid date, the entry will become blank.
Rather than coding each individual date field on Lost Focus, I noticed that you can create one Event Handler that handles all my dates:
EX:
Private Sub Date_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtAAdmitDate.LostFocus,txtAAdmitTime.LostFocus, txtALMP.LostFocus, (etc...)
-------------------------------------------------------------------
This works great when I want ALL my comboboxes to have .dropped down on Got Focus(). I'm using the reference Me.ActiveControl:
(Ex: Me.ActiveControl.droppeddown = True) but for LostFocus, the active control is the NEXT control (that gets tabbed into!) so I can't seem to do the above for LostFocus,I've even tried Leave, but it's the same.
How can I get the Event Handler for all my dates to wipe out the date, if it's invalid, and the user goes to another control (either by tab or mouse)?
Rather than coding each individual date field on Lost Focus, I noticed that you can create one Event Handler that handles all my dates:
EX:
Private Sub Date_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtAAdmitDate.LostFocus,txtAAdmitTime.LostFocus, txtALMP.LostFocus, (etc...)
-------------------------------------------------------------------
This works great when I want ALL my comboboxes to have .dropped down on Got Focus(). I'm using the reference Me.ActiveControl:
(Ex: Me.ActiveControl.droppeddown = True) but for LostFocus, the active control is the NEXT control (that gets tabbed into!) so I can't seem to do the above for LostFocus,I've even tried Leave, but it's the same.
How can I get the Event Handler for all my dates to wipe out the date, if it's invalid, and the user goes to another control (either by tab or mouse)?