Solved in a form or a subform (1 Viewer)

Lampje

Member
Local time
Today, 22:38
Joined
Jul 20, 2021
Messages
31
Forum,

wants to ask with vba if I am in a form or a subform.
Not the name, but for example 1(form) or 2(subform)

Greeting, L
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:38
Joined
Jul 9, 2003
Messages
16,269
What action triggers the request?
 

Lampje

Member
Local time
Today, 22:38
Joined
Jul 20, 2021
Messages
31
Uncle Gizmo,

With Mouseover I want to call a module, this is a one-time to read the controls in the subform.
When I return, I read the controls of the form again.

Greeting, L
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:38
Joined
Jul 9, 2003
Messages
16,269
I was thinking that I have a function that may be of use to you. However my guess is it won't be much use. I reckon you need to provide more information.

The function I was thinking of is in the code at the bottom of this page. The function name is "fGetParentForm"

 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:38
Joined
Feb 19, 2002
Messages
43,203
When you refer to a subform's controls from outside of the subform, do you know for certain what subform record's data you are seeing? Since there is one mainform record and many subform records, this type of request is always suspect.
 

Lampje

Member
Local time
Today, 22:38
Joined
Jul 20, 2021
Messages
31
Uncle Gizmo, Pat Hartman, jdraw

Thank you very much for your time and contribution to find a solution to this problem.
My way of thinking went too far, the solution was simpler than my thought.
Now made a Public variable with which a comparison can be made.

Greeting, L
 

Users who are viewing this thread

Top Bottom