Results 1 to 2 of 2
Thread: Subform freezes on focus
2009-04-27, 17:28 #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
I am building a database to track security access to our offices. I have several tables and the main data entry is done on a main form with two subforms. On the main form and on one of the subforms, I have a textbox that puts the last date/time that record was updated. Seems to work great. Until I try using the subform after updating the main form. I cannot move from the main form to the subform after this textbox updates. The whole form freezes.
I'm very new to VBA, and I tried looking at the code to figure this out myself. It appears the textbox is locking after it updates. If I edit it to leave it unlocked, it doesn't seem to matter. So, I guess I have no idea what I'm doing.
I can attach the db if that will help you.
What I want is: On the main form (employee information), when I enter data into the last form on the field (year), I want the date/time last updated to appear on the form (the textbox) and then I want to be able to go to a subform (locations employee accesses with permissions for access) to enter records and have that subform also show a date/time last updated.
So, should I attach the db or are you a magician and can understand what I've just babbled about?
2009-04-27, 17:38 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Welcome to the Lounge!
I usually set the last modified date of a record in the Before Update event of the form. For example:
Private Sub Form_BeforeUpdate(Cancel As Integer) Me.txtDateModified = Date End Sub