access 2007 - vba - forms collection

Chers tous,

j'ai �crit la fonction suivante pour changer la propri�t� filterOnLoad
de chaque formulaire de la db.

*************************
Function correctAccess2007()

Dim Ff As Form, i As Integer

i = 0

For Each Ff In Forms
    i = i + 1
    DoCmd.OpenForm Ff.Name, acDesign
     Ff.FilterOnLoad = False
    DoCmd.Close acForm, Ff.Name, acSaveYes
Next
MsgBox "forms:" & i
End Function
**********************
quand j'ex�cute sous access2007, il affiche "0".
Si j'utilise le m�me code pour modifier une propri�t� existant en access
2000/2002/2003 (filter, backColor, ...) ca marche!

La collection Forms n'existe plus en 2007????? (mais il ne donne pas
d'erreur quand on l'utilise)

Merci,
Alain
0
Alain
9/5/2007 6:55:16 PM
access 16762 articles. 3 followers. Follow

4 Replies
952 Views

Similar Articles

[PageSpeed] 26

Forms collection = open forms (excluding subforms)
AllForms collection = all Forms in database

    Dim obj As AccessObject
    Dim dbs As Object

    Set dbs = Application.CurrentProject
    For Each obj In dbs.AllForms
        i = i + 1
       DoCmd.OpenForm obj.Name, acDesign
        ........

HTH,



"Alain Bourgeois" <brolspam00@skynet.be> wrote in message 
news:46DEFB94.4627A5B1@skynet.be...
> Chers tous,
>
> j'ai �crit la fonction suivante pour changer la propri�t� filterOnLoad
> de chaque formulaire de la db.
>
> *************************
> Function correctAccess2007()
>
> Dim Ff As Form, i As Integer
>
> i = 0
>
> For Each Ff In Forms
>    i = i + 1
>    DoCmd.OpenForm Ff.Name, acDesign
>     Ff.FilterOnLoad = False
>    DoCmd.Close acForm, Ff.Name, acSaveYes
> Next
> MsgBox "forms:" & i
> End Function
> **********************
> quand j'ex�cute sous access2007, il affiche "0".
> Si j'utilise le m�me code pour modifier une propri�t� existant en access
> 2000/2002/2003 (filter, backColor, ...) ca marche!
>
> La collection Forms n'existe plus en 2007????? (mais il ne donne pas
> d'erreur quand on l'utilise)
>
> Merci,
> Alain 


0
George
9/5/2007 7:06:29 PM
Dim Cont As DAO.Container
Dim Doc As DAO.Document

Dim Ff As Access.Form
Dim i As Integer

Set Cont = Access.CurrentDb.Containers("Forms")
i = 0
For Each Doc In Cont.Documents
  DoCmd.OpenForm Doc.Name, acDesign
  Set Ff = Access.Forms(Doc.Name)
   i = i + 1
    Ff.FilterOn = False
   DoCmd.Close acForm, Doc.Name, acSaveYes

Next 'Doc

HTH

Pieter



"Alain Bourgeois" <brolspam00@skynet.be> wrote in message 
news:46DEFB94.4627A5B1@skynet.be...
> Chers tous,
>
> j'ai �crit la fonction suivante pour changer la propri�t� filterOnLoad
> de chaque formulaire de la db.
>
> *************************
> Function correctAccess2007()
>
> Dim Ff As Form, i As Integer
>
> i = 0
>
> For Each Ff In Forms
>    i = i + 1
>    DoCmd.OpenForm Ff.Name, acDesign
>     Ff.FilterOnLoad = False
>    DoCmd.Close acForm, Ff.Name, acSaveYes
> Next
> MsgBox "forms:" & i
> End Function
> **********************
> quand j'ex�cute sous access2007, il affiche "0".
> Si j'utilise le m�me code pour modifier une propri�t� existant en access
> 2000/2002/2003 (filter, backColor, ...) ca marche!
>
> La collection Forms n'existe plus en 2007????? (mais il ne donne pas
> d'erreur quand on l'utilise)
>
> Merci,
> Alain 


0
Pieter
9/5/2007 7:08:51 PM
 Cont.Documents est invalide...

Pieter Wijnen wrote:
> 
> Dim Cont As DAO.Container
> Dim Doc As DAO.Document
> 
> Dim Ff As Access.Form
> Dim i As Integer
> 
> Set Cont = Access.CurrentDb.Containers("Forms")
> i = 0
> For Each Doc In Cont.Documents
>   DoCmd.OpenForm Doc.Name, acDesign
>   Set Ff = Access.Forms(Doc.Name)
>    i = i + 1
>     Ff.FilterOn = False
>    DoCmd.Close acForm, Doc.Name, acSaveYes
> 
> Next 'Doc
> 
> HTH
> 
> Pieter
> 
> "Alain Bourgeois" <brolspam00@skynet.be> wrote in message
> news:46DEFB94.4627A5B1@skynet.be...
> > Chers tous,
> >
> > j'ai �crit la fonction suivante pour changer la propri�t� filterOnLoad
> > de chaque formulaire de la db.
> >
> > *************************
> > Function correctAccess2007()
> >
> > Dim Ff As Form, i As Integer
> >
> > i = 0
> >
> > For Each Ff In Forms
> >    i = i + 1
> >    DoCmd.OpenForm Ff.Name, acDesign
> >     Ff.FilterOnLoad = False
> >    DoCmd.Close acForm, Ff.Name, acSaveYes
> > Next
> > MsgBox "forms:" & i
> > End Function
> > **********************
> > quand j'ex�cute sous access2007, il affiche "0".
> > Si j'utilise le m�me code pour modifier une propri�t� existant en access
> > 2000/2002/2003 (filter, backColor, ...) ca marche!
> >
> > La collection Forms n'existe plus en 2007????? (mais il ne donne pas
> > d'erreur quand on l'utilise)
> >
> > Merci,
> > Alain
0
Alain
9/5/2007 7:23:26 PM
ok, merci, j'ai pris le meilleur des deux posts: ca marche.

    Dim ff1 As Access.Form
    Dim i As Integer
    Dim ff As AccessObject
    Dim dbs As Object

    Set dbs = Application.CurrentProject

    For Each ff In dbs.AllForms
        DoCmd.OpenForm ff.Name, acDesign
        Set ff1 = Access.Forms(ff.Name)
        i = i + 1
        If ff1.FilterOnLoad Then ff1.FilterOnLoad = False
        DoCmd.Close acForm, ff.Name, acSaveYes
     Next 'Doc


MsgBox "forms:" & i
Alain Bourgeois wrote:
> 
>  Cont.Documents est invalide...
> 
> Pieter Wijnen wrote:
> >
> > Dim Cont As DAO.Container
> > Dim Doc As DAO.Document
> >
> > Dim Ff As Access.Form
> > Dim i As Integer
> >
> > Set Cont = Access.CurrentDb.Containers("Forms")
> > i = 0
> > For Each Doc In Cont.Documents
> >   DoCmd.OpenForm Doc.Name, acDesign
> >   Set Ff = Access.Forms(Doc.Name)
> >    i = i + 1
> >     Ff.FilterOn = False
> >    DoCmd.Close acForm, Doc.Name, acSaveYes
> >
> > Next 'Doc
> >
> > HTH
> >
> > Pieter
> >
> > "Alain Bourgeois" <brolspam00@skynet.be> wrote in message
> > news:46DEFB94.4627A5B1@skynet.be...
> > > Chers tous,
> > >
> > > j'ai �crit la fonction suivante pour changer la propri�t� filterOnLoad
> > > de chaque formulaire de la db.
> > >
> > > *************************
> > > Function correctAccess2007()
> > >
> > > Dim Ff As Form, i As Integer
> > >
> > > i = 0
> > >
> > > For Each Ff In Forms
> > >    i = i + 1
> > >    DoCmd.OpenForm Ff.Name, acDesign
> > >     Ff.FilterOnLoad = False
> > >    DoCmd.Close acForm, Ff.Name, acSaveYes
> > > Next
> > > MsgBox "forms:" & i
> > > End Function
> > > **********************
> > > quand j'ex�cute sous access2007, il affiche "0".
> > > Si j'utilise le m�me code pour modifier une propri�t� existant en access
> > > 2000/2002/2003 (filter, backColor, ...) ca marche!
> > >
> > > La collection Forms n'existe plus en 2007????? (mais il ne donne pas
> > > d'erreur quand on l'utilise)
> > >
> > > Merci,
> > > Alain
0
Alain
9/5/2007 7:37:18 PM
Reply:

Similar Artilces:

Export WPX4 Address book to MS Word 2007?
Is it possible to transfer my WordPerfect X4 address book to Word 2007 for use in addressing envelopes etc.? I have the home and school version of 07. Thanks, Rich Mercer Word doesn't have an address book. It utilises the contacts list of Outlook, which of course the student version of Office does not include. It *may* be possible to extract the data from your WP address book to a Word table to use as a data source for mail merge, but I suspect you may have to do this from Word Perfect. If you still have access to WP, check if it has an option to export to a comma delim...

Configuring Outlook 2007
Hi, I was trying to configure Outlook 2007 to access my mails. I am facing this problem continuosly- If I try to access my hotmail account, it always goes into Offline mode, though I am able to access it through Windows Live. Once or twice, I have been able to download few mails, but never more than than that. The OS is Vista. Thanks ________________________________________ " If you think you can, and if you think you can't, then you are right"- Henry ford Are you using the Outlook Connector? if not, you need it - http://www.microsoft.com/downloads/details.aspx?Fa...

outlook 2007 no problem receiving email but problem sending
I have no problem sending and receiving emails when connected at work but from home, I can receive new messages but there is a problem sending. I get the message Sending reported error 0x80042109. Outlook cannot connect to your outgoing (SMTP) e-mail server. If you continue receiving this message contact your server administrator or ISP. Any ideas please. Thanks, Charlie Have you verified with your corporate mail admin already that the settings have been correct for usage outside of the company network and if this is indeed fully supported by your corporation? If so,...

How to write to the registry in Vista from Access
Hi... This is my first post and I want to know if there is somewhere a code to write to the registry. I have one from someone in the past but I try to use it on Windows Vista and instead of putting the key in the local machine/software it is adding to some virtual folder. Does anyone knows why??? Thanks... This is not really an Access question, but a Vista one. My best guess though is that you need administrative privileges to write to the registry, and Vista by default does not let anyway have those privileges without specifically logging in that way. -- Arvin Meyer, MCP, MVP ht...

Opening Access without Menus displayed
Access 97 I have created a simple data lookup form for a customer to look up his own jobs in a shared database - there is only the one form in the mdb(e) that auto-opens on application startup. I have unchecked all the Startup functions etc. The program auto-opens the form okay but there is the default menu bar displayed across the top of the application window. The tool bars do not show. Is there a way to open the program and not show ANY menus as well? My form close event also quits the application. I intend to provide this as an mde. Any ideas gratefully appreciated Piri Piri wrote: &...

Save as in Access 2002
I have a user who is running Office XP Pro on Windows XP Pro and when she tries to export an Access table to Excel she does not have Excel as an option in the drop down list. Any ideas on how to fix this? Look for the file Msexcl40.dll on the harddrive (it should be in the System folder), and use regsvr32.exe to reregister it. This problem is discussed in http://support.microsoft.com/?id=209805 -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (No private e-mails, please) "Jonathan Hearn" <jhearn@envirocon.com> wrote in message news:002301c3c0de$09859d10$a50...

VBA Worksheet Event Change or Selection Question, please assist me
Two fantastic people were kind enough to provide me these two codes below, and now I'm trying to see if I can expand it to include other columns and data in a worksheet. Code 1: Private Sub Worksheet_Change(ByVal Target As Range) Dim myC As Range If Intersect(Target, Range("P:P")) Is Nothing Then Exit Sub Application.EnableEvents =3D False For Each myC In Intersect(Target, Range("P:P")) Range("Q" & myC.Row).Value =3D Date - Target.Value Next myC Application.EnableEvents =3D True End Sub Code 2: Private Sub Worksheet_Change(ByVal Tar...

Cannot open earlier version of access database
I'm trying to open Northwind database with MS Access 2003. The problem is that a dialog box appears prompting me to go to Database > Tools > Convert Database, however, the dialog box re-appears over a couple of times and disallows the user from doing anything within MS Access. If you are getting the Convert dialog you will need to convert the database to the version that you are working in and save it and then open it next time instead of the original file. During the convert process it will not change the original file. It will make a NEW copy for you to use. I wonder w...

Can't Change Text direction in office 2007
Hi, i have installed office 2007 ( Pro Plus Edition) on a machine. i have faced a strange thing that i have never seen. the option of changing text direction from right to left or left to right does not exist. it come by default with ltr direction. What's the Problem ? Hi, You need to enable a right-to-left language, such as Hebrew or Arabic. To do this, perform the following steps: 1. Close Word. 2. Click Start, click All Programs, click Microsoft Office, click Microsoft Office Tools, and then click Microsoft Office 2007 Language Settings. 3. In the "Available...

Accessing Money reconciled statements?
Is there any way to access past reconciled statements? For some reason, when I went to reconcile it says that my starting balance doesn't match my ending balance from the last statement. I thought I would find the last statement and enter that ending balance as my starting. Not as easy as I thought. Thanks in advance. You won't be able to do that - if the ending balance is modified, you're just shifting the problem back. You'll need to find where you have either deleted a reconciled transaction, or unreconciled a previously reconciled transaction and make an appropri...

Blank Project on MS Project Pro 2007 startup
Does anyone have a code snippet for closing the blank project that is opened when opening project? Or is there a checkbox I have missed that will do this. Hello WJM, You can set Project to open the last file on startup in Tools > Options, General tab. However, I believe there is currently an error in Project 2007 where opening the last file on startup causes an incorrect error message. When you open an existing project plan the Project1 file is closed for you. I guess I'm not sure that a clicking a button to run a macro is any better than using the built in close ...

CRM4
Hi, On CRM4, I obtain an ASP.NET error while trying to access the website of my default organization. The message error is the following : "Caller does not have enough privilege to set CallerOriginToken to the specified value". I didn't find anything on the Web... Does anyone have an idea ? Fabien Majurel I have the same problem, I am going to reinstall and see if that helps Mike "Fabien Majurel" wrote: > Hi, > > On CRM4, I obtain an ASP.NET error while trying to access the website of my > default organization. The message error is the following...

Changing text based on criteria in an access report
Hello, I've got a textbox in a report, some records of which may contain text within { }. I need to find some way to format only that text (which may be in the middle of a string) so that it appears underlined and so that the brackets disappear. To illustrate, I posted a 5KB graphic here: http://img219.imageshack.us/img219/3523/jexamplemb2.png Does anybody have any suggestions or ideas? Thanks in advance! Mitch Access 2007 can format the text for you, using standard HTML for the underlining. Use the Replace() function to swap the braces for the HTML tags. Earlier versions of Ac...

Can't save new contacts in Outlook 2007
When I try to save new contacts in Outlook 2007, I get an error message: "Could not complete the operation. One or more parameter values are not valid." It's been suggested that I clear the forms cache but cannot find how to do that in 2007 (recommended link was for 2003 version). Can anyone help with that or is there another possible solution? P.S. I am working off line in Outlook, if that matters. Also, I can revise and save revisions to existing contacts with no problem. HJ Why are you starting a new thread? Suggest following the recommendations in ...

using interop to create document word 2007
I am using c# and word interop to open a mailmerge document fill it in and then display it to the user. Once i display it the c# app has nothing more to do with the word document. The user can edit it as needed and then save it as a pdf and that is fine. The issue is I would like to set the default path for the document and it could be a network drive or sharepoint and will change every time also it will never be where the original document was opened. ...

A program is trying to access e-mail #2
When I hit new or reply I get this box saying, "A program is trying to access e-mail addresses you stored in Outlook. Do you want to allow this?" Symantec says it's a Microsoft problem. Microsoft says its a security patch sp3? How do I stop this dam message from poping up???? Outlook 2002 SP3 adds additional properties to the list of those that are affected by the security features. As a result, one of your add-ins needs updated to the latest version - antispam add-ins are a common cause although others are affected by the changes as well. Many add-ins were updated follow...

Has anyone linked MS Access and MS Money?
Greetings. I have a registration database for a school that uses MS Access. Our book keeper uses Quicken, so that all the student names, addresses, etc. needs to be entered twice. I am thinking of migrating the financial records to MS Money, so that we can do some VBA programming or the like to send student data from Access to Money. Does anyone know if this can be done, or have any experience doing this sort of thing? Thanks! Gary See http://umpmfaq.info/faqdb.php?q=10 in specific and http://umpmfaq.info/faqdb.php?cat=3 in general. "GaryDave" <garydave@hotmail.com> w...

Auto Populate a form field
I have two tables with 1:1 relationship. Both have same key field (SS Number). There are two forms, one for each table. When I open Form A there is a button to open Form B. When Form B opens, I want SS Number field to equal the SS Number on the current record in Form A. How do I do this? Thank you in advance. Well, IMO the easiest way would be to make Form B a subform of A, and linking via the common key. Or you could make Form A a tabbed form, and A would be the first tab and B would be the second. Just a couple of random thoughts... "A Bit Frustrated&quo...

Remove a document from a workspace in Excel 2007
I have a user who created a workspace and included a file that he now wants to remove from the workspace. Is there a way to remove one file from a workspace? Thank you. ...

Changing Chart SourceData in VBA
Excel 97. Can anyone spot where I'm going wrong? I'm trying to change the source data in code so it only shows upto the last cell that has a value in it. My code at the mo is.. Dim intActiveCell As Integer Dim strCell As String Dim strrange As String Sheets("Financial Tracker").Select Range("C13").Select If ActiveCell <> "" Then Do Until ActiveCell.Value = "" ActiveCell.Offset(0, 1).Select Loop End If ActiveCell.Offset(0, -1).Select 'Selection.End(xlLeft).Select strCell = "R" & ActiveCell.Row & "C" &...

troubles with graphs and VBA macros...
Hello, I'm having troubles with creating some graphs with an Excel VBA Macro. I would like to create about 35 graphs from a set of data stored in a unique datasheet. As the set of data can change (length, numbers, etc ..) I created a macro to generate the graph starting from a template graph. The macro runs correctly a few times but after a variable number of graph (from 5 to 15, it depends on the weather), it crashes with : Run-Time Error '-2147417848 (80010108)' : Methode 'XValues' of object 'series' failed If i go in debug mode and repeat the error, I get :...

Using VBA to find a value and select a range
I am trying to write a macro that will let me find a specific vale in a specific column, then select part of the row that the value is in, beginnign with a column 31 cells away from the column that the specific value is in. Someone suggested to me that I use an IF statement, but this is all I know about that: IF [value in column B] is “Grand Total” Then select from column AF to the end of the array in that row and copy it and paste a transpose of the values starting in cell I9 of worksheet X. What is the best way for me to accomplish this goal? Does this macro do what you...

Create Form Dynamically in VBA
Without going into alot of details I need to create thru code and dynamically a FORM in Datasheet View with a recordsource is an exisiting query. Can this be done in code on the fly. I also need code that deletes or purges the same form object. thanks for any help. Why? It is not a good idea. Perhaps if you described what you want to do, we can help with a how. -- Dave Hargis, Microsoft Access MVP "Bret" wrote: > Without going into alot of details I need to create thru code and dynamically > a FORM in Datasheet View with a recordsource is an exisiting query. Can th...

OnCurrent of Form - Make not visible on condition
I currently have the following code under the onCurrent of my form: Private Sub Form_Current() Dim strSQL As String Dim db As DAO.Database If Me.ID < 0 Then Set db = DBEngine(0)(0) strSQL = "INSERT INTO LastVisitedRecord ( lvCompanyID ) " _ & " VALUES ( " & Me.ID & " ) " db.Execute strSQL Set db = Nothing End If End Sub However, I'd like to add something to it, but have not had success. I'd like the form to evaluate if the NOTES field is empty (which is there but not visible) and if so, make other c...

Change listbox text size in Excel 2007
Using data validation list box function to display a named range, How can the text size be increased when displayed in the list box, How can the number of records displayed be increased from the default This can not be done. See link for further detail and possible workarounds: http://www.contextures.com/xlDataVal08.html#Font -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Maxwell Crompton" wrote: > Using data validation list box function to display a named range, > How can the text size be increased when displayed in ...