473,671 Members | 2,183 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 14741
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
11939
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
2856
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 project; loop through the project and get the web form's control and property information...
19
4093
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 easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
7
2732
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 opened simultaneously), users want the ability to select another patient. Upon selection of another...
10
1796
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 cropped, and aside from the size and the accept button and the cancel button, their properties are...
14
3359
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. My main form has a Next button which makes the main form invisible and starts a new form which I'll...
11
1796
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 we instantiating something in design mode that we should not be? Does this mean anything to anyone?...
8
2053
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
3340
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. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
8474
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8819
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8597
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6222
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2809
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
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.