Solved

a pop-up  form

Posted on 2014-11-17
6
147 Views
Last Modified: 2014-11-26
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?
0
Comment
Question by:akinamon1
6 Comments
 
LVL 10

Expert Comment

by:Gozreh
ID: 40448345
Dont see any thing attached
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 40448379
Look at the arguments for the DoCmd.OpenForm method.  You will see them as you start typing.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40448438
"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
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40448449
form number 2 will pop-up in the form number 1?
You can't actually make a form "pop up" in another form, but you can make a form pop-up in the Access window. As Pat said, use the OpenForm method:

DoCmd.OpenForm acForm "YourFormName", acNormal, , , , acDialog

This would open a Dialog form (i.e. a Popup form that you must interact with). If you want a form to be a Popup form, you have to set those values in the Form Design view.

If you want to show one form in another, you'd use a Subform control. Add a Subform control to your form, and name it something like "sfMySubform". Then, use code like this to show a form named "Form2" in that control:

Me.sfMySubform.SourceObject = "Form2"
0
 

Author Comment

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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question