Link to home
Start Free TrialLog in
Avatar of akinamon1
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?
Avatar of Gozreh
Gozreh
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akinamon1
akinamon1

ASKER

sorry i didn`t understand. for your assistance here is a print screen and i will describe what i need:
User generated imagewhen i click on the button in the navigation screen (form) :"קליטה ממערכת מחוג", it will open in the same window a sub-form called "klita"
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.