Solved

From VBA,  open a from as a "popup" or not.

Posted on 2013-11-03
13
3,088 Views
Last Modified: 2013-11-04
Hi

I am using Office 365 -- Access

I am successfully using the command to open up a form.

        DoCmd.OpenForm "frm Item Categories", , , , , acWindowNormal

Open in new window

I would like to be able to have the option of opening this as a "popup" or not.

How do I do this?
0
Comment
Question by:peispud
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +2
13 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39620466
i don't think there is an option to open a from as Pop-up in vba,
the options are

acdialog
achidden
acicon
acwindownormal
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39620467
Give this a try

Dim lngResponse 

lngResponse = iif (msgbox("Do you want to open the form as a popup") = vbYes, acDialog, acWindowNormal)

DoCmd.OpenForm "frm Item Categories", WindowMode := lngResponse

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
ID: 39620470
cap's right about no specific "popup" option in VBA.  However "Dialog" is the Popup/Modal  combination.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:peispud
ID: 39620491
The "Modal" part of Popup/Modal seems to be a problem in my design hopes.

I would like this form to be one or several help screen that can be dragged onto a second monitor (the popup option allows this).

The "modal" part needs to be closed (so far as I know) before the calling application can continue.

I realize that I can create two identical forms (except for the "Popup" property) to do this, but that seems........
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39620506
have you tried setting the PopUp property to yes in the design view of the form?
0
 

Author Comment

by:peispud
ID: 39620516
Yes I did and it works.

But I need this form to be available to be called up as "help window" on a second monitor.  Later, I need wish for this form to be called up as a full window  / modal (under Access).


In the first instance,  the user would be mostly referencing and looking up data that is already there (primary purpose).

In the second instance, the primary purpose would be to edit /add data.  Ergo, popup / modal.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 125 total points
ID: 39620538
you will then need two forms.
0
 

Author Comment

by:peispud
ID: 39620556
You might be right.   With respect,  I hope not.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39620578
why not, all you have to do is copy and paste the existing form and give it a new name,
then open it in design view and set the properties you require.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 125 total points
ID: 39620610
This is for sure (from Help):

"The PopUp property can be set only in form design view."

Modal on the other hand can be set at run time.

mx
0
 
LVL 30

Assisted Solution

by:hnasr
hnasr earned 125 total points
ID: 39620663
This is a way to open form c as pop up.
You may open the form using VBA in design mode, set pop up property, then open normal, save changes.

DoCmd.OpenForm "c", acDesign
Forms!c.PopUp = True
DoCmd.OpenForm "c", acNormal
DoCmd.Save acForm, "c"

Open in new window

0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 125 total points
ID: 39620674
The design view code does work - but there are a couple of cautions worth mentioning:

1.  I have seen a number of Experts linking run-time design changes to form corruption (I personally have not seen this happen, but don't have any databases where it is routinely done)

2.  IF you intend to distribute your database as an executable (mde/accde), that code will not work, because the Access Runtime version does not permit design changes.
0
 

Author Closing Comment

by:peispud
ID: 39621161
All great and considered answers.   Thanks all,

So it can be done,  but I will go with two different forms in reference to the caution that Mbizup mentioned.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

710 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