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

  • Thread starter Thread starter tbl
  • Start date Start date
T

tbl

Is there a way to trigger the "On Current" event of a
subform from the parent form's "OnActivate" event?
 
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
 
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.
 
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!
 
Back
Top