Solved

Setting popup property of a form using code

Posted on 2008-10-23
6
196 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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22789712
typo

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now