By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

how to open a subform within a main form using a button...

P: 1

can u help me how to open a sub form with in a main form
without opening a new window.....

my main form (frm_searchby_Name)consists
of text field to enter the address and button

when i click the button a new subform window is opening...

can i open in the main form itself?

thank u

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command20_Click()
  2. On Error GoTo Err_Command20_Click
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  7.     stDocName = "sfrm_searchby_Name"
  8.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  10. Exit_Command20_Click:
  11.     Exit Sub
  13. Err_Command20_Click:
  14.     MsgBox Err.Description
  15.     Resume Exit_Command20_Click
  17. End Sub
Oct 11 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,072
For this you can place a subform on the mainform using the subform wizard from the toolbox.
Using the right-click popup menu the "search" you're performing now can be achieved without coding, check:

Oct 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.