I’m at my wits’ end here with this. I’m no stranger to VBA, though I am a fledgling in Access. This seems really simple, but I cannot figure out how to fire off Form_BeforeUpdate. This is in Access 2007 with a database created in Access 2007.
To test when BeforeUpdate fires, I inserted this code under the appropriate form:
Option Compare Database Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String strMsg = "" MsgBox "Form is about to update", vbOKOnly End Sub
I then try to trigger this. I change a field’s content and then press PageUp or PageDown to move to the next record. I added a Save Record button and click that. Neither method is causing my code to trigger. I added a lame button with a MsgBox just to verify that my macros are enabled.
I have this on a subform, but I verified that the code is on the Form_Progress Report form, which is a subform of Form_Student Info. I also opened Form_Progress Report by itself to test it.
Is there something about Form_BeforeUpdate that I just cannot understand? As far as I can tell, the code should be firing just fine, but I cannot find a reason why it wouldn’t. I’m sure it’s something obvious but what?