Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Setting popup property of a form using code

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
snyperj
Asked:
snyperj
  • 3
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Those are Read Only in run time mode. They can only be set in design view.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
From another Form, you *could* ... switch a form to design view, make the change, then switch it back to normal view.

mx
0
 
snyperjAuthor Commented:
Can I do that in the open event of the report?  how do you switch it to design view in code?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Rey Obrero (Capricorn1)Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"how do you switch it to design view in code?"

I think CAP just showed you how.

mx
0
 
Rey Obrero (Capricorn1)Commented:
typo

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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now