Set Form Modal and Popup values to True

D

Dale Fye

I'm using the API call to hide the Access window. Because of this, all of
the forms in my application have to have their Popup and Modal properties
set to True, but this limits editing capability during design, so I
frequently change these values to False (manually).

What I'm wondering is how to do this programmatically. I tried looping
through the forms in the AllForms collection, but I couldn't figure out how
to actually set the values through the code. What I want to do is write a
subroutine that will change these values for all of my forms to either true
or false and save the form.

Thanks,

Dale
 
A

Albert D. Kallal

Really, why hide that grey background?

for about 15 years now, Excel, word, ad most of office has had a main
window, and then child windows. It not likely you going to "shock" your
users by eliminating the most common user interface in existence for the
last 15 years.

All this time your wasting could be used to feed the poor, or get your
application done.

I hope, and apologies if I am sounding too harsh, but I just see such a
little benefit for such a huge effort, and so much of the interface breaks.
You REALLY REALLY need to save the "dialog" forms, and the "model" forms for
correctly controlling your users interface. Note that dialog forms, and
model forms HAVE VERY different uses, and which type of form you use will
VERY much be based on the type of flow and UI that you need for your users.
If you hide that window, and set everything to popups, you nearly destroy
the ability fro you to write a correctly functioning application.

You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc). Also, using these options means you
do not have to bother setting up security.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 
D

Dale Fye

Albert,

This particular client thinks the application looks more "professional" (I
read that as "like VB") if I hide the Access window.

I agree it takes a lot of additional code, and has some downsides, but there
are work-arounds for most of the issues you raise below (I especially hate
having to save reports as snapshots and then use the snapshot viewer to
preview reports). I brought this up to them early on, as I have had others
that liked it both ways. They indicated they wanted it without the gray
background, so that is what they get.

You know the old saying, "the client is always right, so long as they pay by
the hour".

Dale
 
A

Albert D. Kallal

Sure, you make a fair case....

as for reports, all of my open in maximized, model..and I have a custom menu
bar for all reports...

So, once again, I don't use the snapshot. And, my custom menu bar has a
email option (and it converts the current report into a PDF document for
emailing. Once again, I don't see the need for snapshot.

I do understand your arguments about the client, but then again, they been
using Excel and word with that grey background, and "child" windows for
about 15 years now. And, the recent versions of office DO allow a 'windows
in taskbar' option. (just like ms-access does. I would actually consider
just maximising the ms-access windows..and you will not see the grey
background....

As mentioned, I need the model and popup features to correctly manage my
application flow. As you say, you *can* workaround this stuff..but, it
becomes rather trying at times....

Good luck...
 
D

Dirk Goldgar

In
Dale Fye said:
I'm using the API call to hide the Access window. Because of this,
all of the forms in my application have to have their Popup and Modal
properties set to True, but this limits editing capability during
design, so I frequently change these values to False (manually).

What I'm wondering is how to do this programmatically. I tried
looping through the forms in the AllForms collection, but I couldn't
figure out how to actually set the values through the code. What I
want to do is write a subroutine that will change these values for
all of my forms to either true or false and save the form.

Dale, this is air code, but something along these lines ought to do it:

'----- start of air code -----
Sub SetAllFormsModalPopup(Optional fValue As Boolean = True)

Dim ao As AccessObject

DoCmd.Hourglass True

For Each ao In Application.AllForms

DoCmd.OpenForm ao.Name, acDesign, _
WindowMode:=acHidden

With Forms(ao.Name)
.PopUp = bValue
.Modal = bValue
End With

DoCmd.Close acForm, ao.Name, acSaveYes

Next ao

DoCmd.Hourglass False
MsgBox "Done!"

End Sub
'----- end of air code -----

To make all forms PopUp and Modal, execute this:

SetAllFormsModalPopup

To make all form neither PopUp nor Modal, execute this:

SetAllFormsModalPopup False
 
D

Dale Fye

Duh!

Never even considered opening the form in design view programmatically.

Thanks, Dirk
 
D

Dirk Goldgar

In
Dirk Goldgar said:
Sub SetAllFormsModalPopup(Optional fValue As Boolean = True) [...]
With Forms(ao.Name)
.PopUp = bValue
.Modal = bValue
End With

Oops, forgot what I called the argument. Sorry about that. Pick a
name, any name.
 
D

Dale Fye

Worked like a charm!

Dirk Goldgar said:
In
Dirk Goldgar said:
Sub SetAllFormsModalPopup(Optional fValue As Boolean = True) [...]
With Forms(ao.Name)
.PopUp = bValue
.Modal = bValue
End With

Oops, forgot what I called the argument. Sorry about that. Pick a name,
any name.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Popup/Modal Problems 2
Property Popup gives an error 2
Popup and Modal Properties set to Yes 2
Modal property help 3
pop up and modal 1
shortcut menu and popup modal form 2
Cant See Form 2
Sizing of Modal Form 3

Top