473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 14689
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. Many thanks.
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 go through the database -> forms collection and...
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 front end do not write something that will automate...
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 multiple forms; with1-4 forms opened at the same time...
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, but when I run the application, it crops off the...
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 and retain the data users have entered. I thought...
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 redisplaying a c1flexgrid. maxing out our cpu's. By...
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 Design View icon. I checked the forms' properties...
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 opened. Example: ZipCode. When the user enters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...

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.