Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a subform

Status
Not open for further replies.

badrack

Technical User
Jun 11, 2001
4
US
I was wondering if there is any way to not open a subform when the main form is opened but have it open after a record is created. Is this possible or do I need to make it a seperate form and tie it together with a macro?
 
Try these two code snippets. The first hides the subform when you open the main form. The second makes that subform visible when you add a new record. It worked for me.


Private Sub Form_Open(Cancel As Integer)
Me!Subform.Visible = False
End Sub

Private Sub Form_BeforeInsert(Cancel As Integer)
Me!Subform.Visible = True
End Sub
 
Omega, I tried your code substituting Me! with TBL_TENSILE but it gives me a variable not defined error. How do I define the variable in Visual Basic?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top