Trigger Subform "On Current" from Parent Form "On Activate"?

T

tbl

Is there a way to trigger the "On Current" event of a
subform from the parent form's "OnActivate" event?
 
G

Guest

In the subform, change the Private keyword on the subform's Form_Current
event to Public

In the parent form's general declaration declare a variable

Public mParentLoad as boolean

In the parent form's Form_Load event add the following:

mParentLoad = False

In the parent form's Form_Activate event add the following:

If mParentLoad = True Then
Form_subform.Form_Current
Else
mParentLoad = True
End If
 
M

Marshall Barton

tbl said:
Is there a way to trigger the "On Current" event of a
subform from the parent form's "OnActivate" event?

Just call the subform's Current event (after making it
Public):

Me.subformcontrol.Form_Current

Why do you need to use the Activate event? It is a rather
unusual event to use for most any purpose.
 
T

tbl

Just call the subform's Current event (after making it
Public):

Me.subformcontrol.Form_Current

Why do you need to use the Activate event? It is a rather
unusual event to use for most any purpose.


thanks for the reply, Marshal.

Actually, I no longer recall what I was up to with that,
other than thinking that I wanted the subform code to run
when the main form opened and got settled. But that was
just an errant track, I'm now thinking.

I was actually able to make my subform do what I wanted (a
type of autonumbering for Page Numbers and Line Numbers) by
requerying it from the main form's On Current property.

There's probably a far better way to do what I want, but at
my level of expertise, if it seems to work, I'll go with it.
The "todo" list is growing in multiples of the "got it done"
list!
 

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