473,569 Members | 2,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14717
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thomp songroup.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.N ame) 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.Cur rentProject
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
DoCmd.OpenForm obj.Name, acDesign
If Forms(obj.Name) .AllowDesignCha nges = True Then
Debug.Print "Updating AllowDesignChan ges for " & obj.Name
Forms(obj.Name) .AllowDesignCha nges = 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.Cur rentProject
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
DoCmd.OpenForm obj.Name, acDesign
If Forms(obj.Name) .AllowDesignCha nges = True Then
Debug.Print "Updating AllowDesignChan ges for " & obj.Name
Forms(obj.Name) .AllowDesignCha nges = 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.c om:
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thomp songroup.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.Conta iners("Forms"). Documents
- Inside this loop, use objForm.Name to determine the form name,
open the form in design view, use Forms(objForm.N ame) 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 turnOffFormProp s()
Dim strForm As String, db As DAO.Database
Dim doc As DAO.Document
Set db = CurrentDb

For Each doc In db.Containers(" Forms").Documen ts
strForm = doc.Name
DoCmd.OpenForm strForm, acDesign
Debug.Print Forms(strForm). Properties("All owDesignChanges ")
Forms(strForm). Properties("All owDesignChanges ") = 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.c om:
On 15 Jun 2005 07:39:29 -0700, "AP" <ap******@thomp songroup.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.N ame) 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********@bwa y.net.invalid> schreef in bericht news:Xn******** *************** ***********@24. 168.128.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:
'GetRidOfAutoCo rrect' (you provided code with this name IIRC)
'GetRidOfSubDat aSheets'
'GetRidOfSomePr ops'

Arno R
Nov 13 '05 #7
"Arno R" <ar***********@ tiscali.nl> wrote in
news:42******** *************@d reader2.news.ti scali.nl:
"David W. Fenton" <dX********@bwa y.net.invalid> schreef in bericht
news:Xn******** *************** ***********@24. 168.128.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:
'GetRidOfAutoCo rrect' (you provided code with this name
IIRC)
'GetRidOfSubDat aSheets'
'GetRidOfSomePr ops'


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******** *************@d reader2.news.ti scali.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
11934
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. Many thanks.
6
2840
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 go through the database -> forms collection and loop through all the forms in a database and pull information about the form (controls and properties). We would need to do the same in our VB.NET...
19
4078
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 front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can...
7
2726
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 multiple forms; with1-4 forms opened at the same time for the same patient; each form showing a different type of patient-related information. After viewing information for one patient (say on 3 forms...
10
1790
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, but when I run the application, it crops off the bottom of almost every form. I haven't figured out yet if there's a pattern to it. I compared two forms -- one that looks okay and one that gets...
14
3348
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 and retain the data users have entered. I thought I'll make the inactive forms invisible but this is creating a memory corruption problem when user close the form2 or form3 and not the formMain. ...
11
1790
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 redisplaying a c1flexgrid. maxing out our cpu's. By attaching to the process from another visual studio, I can get it to break on some user code with this huge callstack, most of which is native. So are...
8
2045
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 Design View icon. I checked the forms' properties to no avail. What did I do wrong? How do I correct and avoid this mistake in the
21
3308
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 opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. ...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.