Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setting popup property of a form using code

Posted on 2008-10-23
6
Medium Priority
?
245 Views
Last Modified: 2008-11-17
How can I turn the pop up property of a form on and off using vba?  I am using Access 2000 which does not allow you to set a pop up property for reports (didn't start until acc 2002, i think).  So I have a pop-up form that I need to print preview a report from .  I was thinking I could just set the popup property to false when I click the command button to preview the report and then maybe set it back to true in the on close event of the report?   Will that work?  I can't get it to work.

In the on click event of the command button that previews the report, I tried bot:
me.popup  = false
me.form.popup = false

and both give me the same error: "You can't assign a value to this object"
0
Comment
Question by:snyperj
  • 3
  • 2
6 Comments
 
LVL 75
ID: 22789304
Those are Read Only in run time mode. They can only be set in design view.

mx
0
 
LVL 75
ID: 22789347
From another Form, you *could* ... switch a form to design view, make the change, then switch it back to normal view.

mx
0
 

Author Comment

by:snyperj
ID: 22789366
Can I do that in the open event of the report?  how do you switch it to design view in code?
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22789610
for whatever purpose you want to use this

private sub report_open(cancel as integer)
docmd.openform "x" ,acdesign,,,,achidden
forms!x.popup=false
dcmd.close acform,"x",acsaveyes

end sub

to turn it back on in the close event of th report

private sub report_close()
docmd.openform "x" ,acdesign,,,,achidden
forms!x.popup=true
dcmd.close acform,"x",acsaveyes
end sub




0
 
LVL 75
ID: 22789663
"how do you switch it to design view in code?"

I think CAP just showed you how.

mx
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 22789712
typo

dcmd.close acform,"x",acsaveyes
s/b
docmd.close acform,"x",acsaveyes
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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 …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

916 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