472,353 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Loop through all forms to set Allow Design Changes Property

AP
I personally cannot stand the Allow Design Changes property set to
anything other than design view. Is there a way to loop through all
forms and set this property to design view only? There always seem to
be a few forms that slip past and I figured this would be a good way to
make sure they were all changed.
Thanks

Nov 13 '05 #1
9 14594
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thompsongroup.com> wrote:
I personally cannot stand the Allow Design Changes property set to
anything other than design view. Is there a way to loop through all
forms and set this property to design view only? There always seem to
be a few forms that slip past and I figured this would be a good way to
make sure they were all changed.
Thanks


Yes there is. I don't have any code in front of me to remember the exact
statements required, but in general...

- Create an object variable called objForm of type AccessObject, and use it in
a For Each loop over CurrentProject.AllForms.

- Inside this loop, use objForm.Name to determine the form name, open the form
in design view, use Forms(objForm.Name) to reference the open form, and set
the property, then close the form using the option to save changes.

Before running this code, make sure no forms are open.
Nov 13 '05 #2
jv
if you are using ADP, here's the code that I used:

Public Sub UpdateForms()
On Error Resume Next
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
DoCmd.OpenForm obj.Name, acDesign
If Forms(obj.Name).AllowDesignChanges = True Then
Debug.Print "Updating AllowDesignChanges for " & obj.Name
Forms(obj.Name).AllowDesignChanges = False
End If
DoCmd.Close acForm, obj.Name, acSaveYes
Next obj
End Sub

Nov 13 '05 #3
On 15 Jun 2005 08:45:55 -0700, "jv" <ju***********@hotmail.com> wrote:
if you are using ADP, here's the code that I used:

Public Sub UpdateForms()
On Error Resume Next
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
DoCmd.OpenForm obj.Name, acDesign
If Forms(obj.Name).AllowDesignChanges = True Then
Debug.Print "Updating AllowDesignChanges for " & obj.Name
Forms(obj.Name).AllowDesignChanges = False
End If
DoCmd.Close acForm, obj.Name, acSaveYes
Next obj
End Sub


That code should work fine in either an ADP or an MDB, FWICS.
Nov 13 '05 #4
Steve Jorgensen <no****@nospam.nospam> wrote in
news:d6********************************@4ax.com:
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thompsongroup.com>
wrote:
I personally cannot stand the Allow Design Changes property set to
anything other than design view. Is there a way to loop through
all forms and set this property to design view only? There always
seem to be a few forms that slip past and I figured this would be
a good way to make sure they were all changed.
Thanks
Yes there is. I don't have any code in front of me to remember
the exact statements required, but in general...

- Create an object variable called objForm of type AccessObject,
and use it in a For Each loop over CurrentProject.AllForms.


If you're in A97, which didn't have that collection:

CurrentDB.Containers("Forms").Documents
- Inside this loop, use objForm.Name to determine the form name,
open the form in design view, use Forms(objForm.Name) to reference
the open form, and set the property, then close the form using the
option to save changes.

Before running this code, make sure no forms are open.


Here's the A97 code:

Public Sub turnOffFormProps()
Dim strForm As String, db As DAO.Database
Dim doc As DAO.Document
Set db = CurrentDb

For Each doc In db.Containers("Forms").Documents
strForm = doc.Name
DoCmd.OpenForm strForm, acDesign
Debug.Print Forms(strForm).Properties("AllowDesignChanges")
Forms(strForm).Properties("AllowDesignChanges") = False
DoCmd.Close acForm, strForm, acSaveYes
Next doc

Set doc = Nothing
db.Close
Set db = Nothing
End Sub

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5
Steve Jorgensen <no****@nospam.nospam> wrote in
news:d6********************************@4ax.com:
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thompsongroup.com>
wrote:
I personally cannot stand the Allow Design Changes property set to
anything other than design view. Is there a way to loop through
all forms and set this property to design view only? There always
seem to be a few forms that slip past and I figured this would be
a good way to make sure they were all changed.
Thanks


Yes there is. I don't have any code in front of me to remember
the exact statements required, but in general...

- Create an object variable called objForm of type AccessObject,
and use it in a For Each loop over CurrentProject.AllForms.

- Inside this loop, use objForm.Name to determine the form name,
open the form in design view, use Forms(objForm.Name) to reference
the open form, and set the property, then close the form using the
option to save changes.

Before running this code, make sure no forms are open.


Silly me. You don't need to run the code in A97.

DBs converted from A97 either don't have the property or set it to
False, which is one reason why it was ages before I ever even knew
this "feature" existed (and, yes, I mean to ridicule the
introduction of what looks to me like a completely useless feature).

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6

"David W. Fenton" <dX********@bway.net.invalid> schreef in bericht news:Xn**********************************@24.168.1 28.74...

Silly me. You don't need to run the code in A97.


David, did you have your brains dilated today? ;-)

Seriously, I have not noticed the property until this very moment ...
Anyone using it? When?

So we might need:
'GetRidOfAutoCorrect' (you provided code with this name IIRC)
'GetRidOfSubDataSheets'
'GetRidOfSomeProps'

Arno R
Nov 13 '05 #7
"Arno R" <ar***********@tiscali.nl> wrote in
news:42*********************@dreader2.news.tiscali .nl:
"David W. Fenton" <dX********@bway.net.invalid> schreef in bericht
news:Xn**********************************@24.168.1 28.74...

Silly me. You don't need to run the code in A97.


David, did you have your brains dilated today? ;-)

Seriously, I have not noticed the property until this very moment
... Anyone using it? When?

So we might need:
'GetRidOfAutoCorrect' (you provided code with this name
IIRC)
'GetRidOfSubDataSheets'
'GetRidOfSomeProps'


Well, I've got code for the first two, plus what I just posted to
get rid of the stupid property that causes property sheets to end up
displayed when you forget to close the property sheet during
development.

That seems like the kind of thing that is going to trip up the
novice more often than the professional, but it's something that
would help only the pro if it had any use at all, so it just seems
like a very dumb feature.

The on thing I *really* wish I could turn off is displaying the
subforms in place! What a colossally stupid feature!

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8
> The on thing I *really* wish I could turn off is displaying the
subforms in place! What a colossally stupid feature!

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc


Michka has a 'solution' (well, it helps...) for that, you know the "TSI Subforminator" I guess?

Also what I do sometimes is:
- Open the subform(s) in design view first, before opening the main form.

Arno R
Nov 13 '05 #9
"Arno R" <ar***********@tiscali.nl> wrote in
news:42*********************@dreader2.news.tiscali .nl:
The on thing I *really* wish I could turn off is displaying the
subforms in place! What a colossally stupid feature!

--
David W. Fenton
http://www.bway.net/~dfenton dfenton at bway dot net
http://www.bway.net/~dfassoc
Michka has a 'solution' (well, it helps...) for that, you know the
"TSI Subforminator" I guess?


I haven't done enough A2K development to download it, but, yes, I
did know about it.
Also what I do sometimes is:
- Open the subform(s) in design view first, before opening the
main form.


That's how I always work.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: trenchmouth | last post by:
Does anybody know how I can loop through all the properties in a class I have created? Can I use Me to refer to the properties? I'm using VB6. ...
6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a...
7
by: Jeff | last post by:
I plan to write a Windows Forms MDI application for a medical office. Users must be able to select a patient and view related information on...
10
by: RobinS | last post by:
Hello to all, and happy new year! I have this application that someone wrote that I'm sort of checking out. The forms look fine in design mode,...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms...
11
by: Tom C | last post by:
We have a window named FormApplication which just happens to be our mid parent window. When I open it in the designer, it is stuck in a loop...
8
by: zufie | last post by:
Hi, I created some forms using the "Create form using Wizard". However, I cannot view the forms I created with Wizard unless I click on the...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.