akinamon1
asked on
a pop-up form
See attached.
How do I write a VBA code that when I click the button : "קליטת נתונים מהמחוג"", the form number 2 will pop-up in the form number 1?
How do I write a VBA code that when I click the button : "קליטת נתונים מהמחוג"", the form number 2 will pop-up in the form number 1?
Dont see any thing attached
Look at the arguments for the DoCmd.OpenForm method. You will see them as you start typing.
"pop-up in the form number 1?"
Do you mean a popup, or are you looking for a subform that is hidden on (embedded in ) form one, that is hidden until the button is clicked? If the latter, then you have to create a subform (name it "sub_form") control on the main form. Leave the SourceObject blank, and set the visible property to No.
The, use the button click event to set the SourceObject and Visible Properties:
Private SUB yourButtonName_Click
me.sub_form.SourceObject = "Form2Name"
me.sub_form.Visible = true
End Sub
If the form and subform are supposed to be linked on a value then you will probably need to set the subforms LinkMasterFields and LinkChildFields properties as well
Do you mean a popup, or are you looking for a subform that is hidden on (embedded in ) form one, that is hidden until the button is clicked? If the latter, then you have to create a subform (name it "sub_form") control on the main form. Leave the SourceObject blank, and set the visible property to No.
The, use the button click event to set the SourceObject and Visible Properties:
Private SUB yourButtonName_Click
me.sub_form.SourceObject = "Form2Name"
me.sub_form.Visible = true
End Sub
If the form and subform are supposed to be linked on a value then you will probably need to set the subforms LinkMasterFields and LinkChildFields properties as well
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Those look like navigation buttons?
If so, then I'm not sure you have much control over the process. The Navigation Buttons basically open a form as defined in the "Navigation Target Name" in the NavigationSubform control associated with the Navigation Control.
That said - if you set the "Navigation Target Name" property to "klita", this should open that form in the Navigation Subform. You can access the setting by opening the Navigation form in Design view, and then click the Data tab in the Properties dialog.
If so, then I'm not sure you have much control over the process. The Navigation Buttons basically open a form as defined in the "Navigation Target Name" in the NavigationSubform control associated with the Navigation Control.
That said - if you set the "Navigation Target Name" property to "klita", this should open that form in the Navigation Subform. You can access the setting by opening the Navigation form in Design view, and then click the Data tab in the Properties dialog.