MS Access Forum / Forms / May 2007
Set Form Modal and Popup values to True
|
|
Thread rating:  |
Dale Fye - 05 May 2007 16:55 GMT 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
Albert D. Kallal - 05 May 2007 21:04 GMT 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
 Signature Albert D. Kallal (Access MVP) Edmonton, Alberta Canada pleaseNOOSpamKallal@msn.com
Dale Fye - 05 May 2007 21:58 GMT 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
> Really, why hide that grey background? > [quoted text clipped - 37 lines] > want. You can get this at: > http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html Albert D. Kallal - 05 May 2007 22:45 GMT 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...
 Signature Albert D. Kallal (Access MVP) Edmonton, Alberta Canada pleaseNOOSpamKallal@msn.com
Dirk Goldgar - 07 May 2007 01:28 GMT > 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 [quoted text clipped - 6 lines] > 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
 Signature Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
Dale Fye - 07 May 2007 02:10 GMT Duh!
Never even considered opening the form in design view programmatically.
Thanks, Dirk
>> 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 [quoted text clipped - 43 lines] > > SetAllFormsModalPopup False Dirk Goldgar - 07 May 2007 04:25 GMT > 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.
 Signature Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
Dale Fye - 07 May 2007 23:21 GMT Worked like a charm!
>> Sub SetAllFormsModalPopup(Optional fValue As Boolean = True) > [...] [quoted text clipped - 5 lines] > Oops, forgot what I called the argument. Sorry about that. Pick a name, > any name.
|
|
|