Unanswered: Lost Focus and Exit Events not running?
I have an access 2000 db with 1 form and several text boxes. All text boxes are bound to different fields in 1 table. The problem I am having is when moving to the next text box, the lost focus and exit events are not running. Here is an example:
Private Sub Text1_LostFocus()
Msgbox "Lost Focus"
Private Sub Text1_Exit (Cancel as Integer)
When the user enters text into Text1, and then moves to the Text2, no message boxes are seen.
One other thing, sometimes on some of the text boxes, the lost focus will work, sometimes the exit will work, and sometimes neither.
I was hoping for a different solution other than setting up unbound text boxes for data entry, copying the text to hidden bound text boxes and updating the table.
I had this happen to an existing app/DB that was WinZipped and backed up to a floppy. Had some help from a bud at work who couldn't figure it out either, and now I can't figure out how he did this, but he turned off something that allowed ADO or DOA use (can't find it now) and then turned it right back on and it seemed to be ok then. If you really want to know, I can check with him tomorrow at work.
Your subroutines are labeled Text1_LostFocus and Text1_Exit.
If you subsequently renamed your control boxes to something more descriptive the subroutines are not automatically renamed and will not be called. You will have to rename the subroutines and make sure the control boxes reference them correctly.
For anyone else that has this problem, here was my solution. Thanks to GringoMike on experts-exchange. The problem and solution was exactly what happened. Thanks for everyones help.
Check to make sure that all text boxes' "Event" properties actually point to a procedure in the form's code. Sometimes when I design a quick form and use the VB editor drop-down box to select the objects & events, the don't actually get "linked" to the object on the form because I didn't go thru the form's design view, properties, object's event tab in properties, and create the procedure from there.
Bottom line, for every text box that doesn't work, look in the "Event" properties to make sure that it says "[Event Procedure]" and points to a procedure in the form's code. I can clarify if needed.