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
hi

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
ssr

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


nico5038
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:
http://www.geocities.com/nico5038/xR...nstruction.zip

Nic;o)
Oct 11 '07 #2

Post your reply

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