Subfrom's "Current" Event does not fire

L

Lebedev

I'm using Access 2000 on a Windows 2000 Pro computer.

I have a form that is bound to a table. In the form's "Current" event
procedure I have the following code:

Private Sub Form_Current()
MsgBox ("Hello")
End Sub

If I load the form on its own, the Current event fires on load, and
when navigating through the records.

However, when the form is a subform, the Current event does not fire
at all. Not on load, and not when navigating through the records using
the subform's built-in navigation buttons.

Originally the Main Form was unbounded, and the navigation buttons
disabled. I have since "bound" the Main Form to the same table as the
Subform, and linked Master/Child to the same field in the table. The
Subfrom's Current event will still not fire when using the Main Form's
navigation buttons.

I have tried to search for previous posts regarding this, but even
though there are many posts that seem to be dealing with this problem,
it turns out that those solutions don't apply to my situation.

Any help would be appreciated. This is getting very frustrating!

Thanks,
-Lebedev
 
T

TC

Sorry, a bound (sub)form's Current event definitely will fire, as you
move from record to record. So there must be something else wrong.

Here's what I'd do. Open the subform's code module. Hilite all content.
Hit ^x to cut, ^v to paste. Compile-all, then save & close the subform.
Then try again.

Sometimes, an event procedure gets disconnected from the actual event.
The code is still ther, but it jst doesn't fire. In my experience,
cutting & pasting always fixes this.

HTH,
TC
 
D

Douglas J. Steele

TC said:
Sorry, a bound (sub)form's Current event definitely will fire, as you
move from record to record. So there must be something else wrong.

Here's what I'd do. Open the subform's code module. Hilite all content.
Hit ^x to cut, ^v to paste. Compile-all, then save & close the subform.
Then try again.

Sometimes, an event procedure gets disconnected from the actual event.
The code is still ther, but it jst doesn't fire. In my experience,
cutting & pasting always fixes this.

I've got code to detect and fix problems like that in my March 2004 "Access
Answers" column in Pinnacle Publication's "Smart Access". You can download
the column (and sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top