open sub form when command button is clicked

Hi Experts

How would you write the vba to open a sub form called mac_2 when command button, cmdsubform is clicked. .m
route217Asked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
Do you mean:

1.  A true subform that is embedded in your main form

OR

2.  A separate popup form

?


If 1 (a true, embedded subform), then you don't need to "open" a subform.  You can set it's visible property to false in your main form's design, and then in the command button click event:

Me.[mac_2].Visible = true

if 2 (a separate popup) then:

Docmd.OpenForm "mac_2"
0
 
route217Author Commented:
Excellent two positive thing learnt...

Thanks for the feedback.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.