how to open a sub form with in a main form using command button...

ssr

New member
Local time
Yesterday, 21:03
Joined
Oct 11, 2007
Messages
1
hi

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

i tried to do but i am getting a new window...

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

my sub form (sfrm_searchby_Name) consists of record
source an inline function which accepts i/p parameter
a address and i assigned the input parameter
field in the subform to the text field of main form.

so
when i click the button a new subform window is opening...
instead is there a way to open within the form itself??




thank u
ssr


Code: ( vb )
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "sfrm_searchby_Name"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub
 
why not just make it visible instead of opening it?

Have it in there and dont show it until the button is clicked?
 
Similar problem - want to use button to open related subform survey

I am trying to solve a similar problem, but my subform screen is much larger than the original form. I am reworking and combining 2 databases to serve a new purpose, using the structure of one, and the survey form from another. I would like the survey form to open when the button is pushed, and reference information from some of the fields on it with the base form. Can you help?
 
why you don't just open it in a subform within the form it self
just add a subform control (child1)to your form and link it to the subform you need to open
make it visible / invisible by clicking the command

or make the command link it to your subform

Private Sub Command20_Click()
On Error GoTo Err_Command20_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "sfrm_searchby_Name"
child1.SourceObject = stDocName

Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub
 
Thanks for your reply

Thank you for your reply...The original form is a tabbed page on a form that is a dialog box of a specific size (smaller than full screen). If I open the form as a subform directly on the form, it is too big. So I would like to open it full-screen when the button is clicked on top of the dialog box in the background. BUT I still want it to be related to the data displayed on that screen of the form like a subform would be.
 

Users who are viewing this thread

Back
Top Bottom