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
944 Views

Similar Articles

[PageSpeed] 30

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:

Money 2007 E-Pay
Noticed this morning when I was paying my bills this anomaly. Perhaps I am missing something. Scenario: Paying a credit card bill. In Money 2004 (my previous version of Money) I would use Credit Card as the category and in the subcategory use the particular credit card account I was paying. Worked great. Money 2007, there is a new category named Credit Cards/Transfer. When selecting this there are no payee categories listed. However further down the list is another category named Credit Card. Using Credit Card shows the various payees. Not sure what the difference is between Credit C...

Passing data from one form to another
Hello I have a form called frmMaindB and it has 5 text boxes on it (txtEmployeeTime, txtDTRegular, txtDTReason1, txtDTReason2, txtDTMaintenance) when I double click on the text box it opens up a pop up form named frm_DecimalConversion. On this form I have two text boxes one box I enter data into and the other calculates or converts the data to a decimal. The box that converts the data is called txtDecimal. Then I have a close button which I want to use to close the pop up form and insert the data into the text box I double clicked in to get the pop up or (frm_DecimalConversion). I have r...

data value in Form field if no table entry
I have a form with a field which pulls through and concentenates 2 fields called [ContactFirstname] and [ContactLastName]from my table There are however some customers for whom I do not have names and therefore instead I would like Sir/Madam to appear in the field in the form I think I have seen this done somewhere using ELSE? but can't find it Any help/ideas gratefully received Perhaps something like this: Nz(Trim([ContactFirstname] & " " + [ContactLastName]), "Sir/Madam") -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access use...

how to query my web site from VBA and return a value to VBA
Hello All, From VBA I would like send a value to my web site, and have it return a value. I've learned how to use FollowHyperlink to send a value to an ASP script, but how can the ASP script send a value back to VBA?? Thanks, Brian Austin, TX You can use xmlhttp to make a request to your web page: '********************************************************* Sub Tester() MsgBox WebResponse("http://www.mydomain.com/myactualpage.asp? info=3Dblah") End Sub Private Function WebResponse(sURL As String) As String Dim XmlHttpRequest As Object Se...

How do I create a bookfold document in Word 2007?
I am new to Word 2007. How do I create a document in booklet form? Thanks I'm sure you'll get better answers in an MSWord forum. dadolim wrote: > > I am new to Word 2007. How do I create a document in booklet form? Thanks -- Dave Peterson ...

2007 calendar
How can I create a 1 page 2007 calendar in publisher? File, new, publications for print, calendars, select one, select yearly... click Change date range. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Angel" <Angel@discussions.microsoft.com> wrote in message news:7253E645-B0BA-4B90-BF7E-7083802EA379@microsoft.com... > How can I create a 1 page 2007 calendar in publisher? ...

making an equation in access
Hi, I would like to create a field that works out a formula based on other fields. i.e field z=field4, when field 1<field 2 - field 3 etc. Yes, it may be a silly question but I am only new to this....Thanks, Dani. Dani, recommend against creating a "field" in a table and storing this value. One of the generally accepted rules of relational database development is not to store a "computed" (any value that is based on the value of other fields in your database) value in the table. It is a waste of database space, and will eventually result in bad data (...

How to use structured reference (ListColumns) in VBA
I want to do something simple...loop through a range retrieving values one at time and taking action on that value. This range is an Excel 2007 table column. Easy enough...BUT I want to use structured references to a table column by NAME, not numbers. I don't want to define new names, just use the table column headings. I've found ways of doing it with quotes, but that's not structured....the names in quotes do not change if the table heading is changed by the user. The formulas change if the table column heading is changed, but I want it to change in VBA to...

VISIO 2007 -Text direction
can some one tell me how to change text to be type in vertically. Under tools, options there is no regional tab or under format text the change text direction command does not work. "kgbrat" <kgbrat@discussions.microsoft.com> wrote in message news:2DBF18B5-E1C8-4493-8BEF-F7D4C1538781@microsoft.com... > can some one tell me how to change text to be type in vertically. Under > tools, options there is no regional tab or under format text the change > text > direction command does not work. You can use the Text Tool (The A with an circular arrow around it) and gr...

form and query problem. please help.
All tables are linked with weak entities. However, when i enter data on the form I can't get it to let me enter more than one partipicant without access generating a new invoice id. however i need one invoice to many participants. It wont work and i have no idea what to do at this point. in addition the workshop will not let me add workshop to invoice. this is a small mdb and i'd like to email it to anyone who can assist me with the relationships as I think this is the problem but I don't know what to do. please help me. INVOICE invoiceNO - autonumber invoice prices WORKSHOP wo...

2007 License
I received a free Office SBA 2007 via an MS Partner Program as a download together with key There is no FPP, OEM or MLK designation. (The EULA in Word being dependant on the above) How can I determine if this is licensed to install on a second device, other than trying? - The PID? Contact the MS Partner Program? "DL" <notvalid@spoofaddress.co.uk> wrote in message news:uVA$w8lpKHA.4648@TK2MSFTNGP06.phx.gbl... :I received a free Office SBA 2007 via an MS Partner Program as a download : together with key : There is no FPP, OEM or MLK designation. : (The EULA...

Printing Word and excel documents via excel vba
I have a document that has some Excel and some word content i would like to use excel vba to print both a page from word and then a page from excel. I know how to select and open the word document, however i cant find any code to print page X from word. basically i need to: print page 1 of c:\xx\document1.doc print page1 of sheet1 of c:\yy\excelwkbk1.xls print page 2 of c:\xx\document1.doc print page2 of sheet1 of c:\yy\excelwkbk1.xls and so on it will require moving between word and excel - the excel bit i get, but getting back to excel from word, and printing out in word is slightly more...

Using Excel spreadsheet as input to Access
Hello, I posted this in the New Users forum but only got one answer, so thought I'd try here as well. Like so many others, I am an Excel newbie. I was a mainframe COBO programmer in another life, but that was a few years back My manager would like me to write an app that will take tracking dat from an existing Excel spreadsheet (generated by our system) but onl use a select handful of columns as input to a new Access database tha I will create. I'm guessing that I can either a) create a new edited spreadsheet to b used as input to the Access database or b) use the Import wiza...

Office 2007 11-23-09
Of all the choices out there (community discussion, dashboard, live, etc.) how can I contact someone with input on Microsoft's software. For example, I want to know why any one would not display the most common commands on the HOME tab in Office 2007. Print, Save, Open, Close, Spell Check, Undo, etc. etc. etc. Yes, I know you can customize your own Toolbar, but not a beginner. How can I emphasize how important this is, I don't suppose you can customize the Tabs. I would like to ask someone why they can't get input from those of us who teach their products. ...

Using Risk+ with MSP 2007
We use Risk+ as a risk simulation tool. We have discovered that it works approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run into this problem. If so, is there a remedy? My hunch this not a generic issue, but surely best that you consult with the Risk+ people on this. --rms www.rmschneider.com On 02/03/10 18:08, Tom Mc wrote: > We use Risk+ as a risk simulation tool. We have discovered that it works > approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run > into this problem. If so, is there a remedy? W...

Personal.xls not hidden in Excel 2007?
Hi, When I open a spreadsheet in Excel 2007 my Personal.xls file opens too, in a separate window. (I get a separate "tab" in my task bar.) If I remember correctly from Excel 2003 the Personal.xls was actually hidden and didn't open, but the macros in it were made available to open worksheets. In any case, that is the behavior I would like. Is there a setting somewhere that makes the Personal.xls stay hidden? I've tried putting it in program files/.../xlstart and in application data/.../xlstart. I've also tried making it a .xlsb file. Thanks, Sam I haven't tried...

Access To Word Mailmerge
I have setup a Mailmerge that is run from Access. The process works like this: 1) The proper record is selected in an Access form which automatically starts the process. 2) Word is called up automatically, it shows both the template and the doument with the proper data in it. 3) Access is closed automatically. 4) The user then needs to close the mailmerge template. 5) The document with the proper mailmerge information inserted from Access is up on the screen. At this point a shortcut is triggered by the user that adds a document of the users choice to the end of the curre...

Outlook Web Access HTTP 500 and HTTP 404 errors
hi, I am experiencing this problem on Exchange 2003 on Windows 2003, when the users try to authenticate to Outlook Web Access, they get the following error messages in their browsers, "http 500 - internal server error" or "http error 404 - file or directory not found", the customer upgraded to windows/exchange 2003 6 months ago from windows/Exchange 2000 (in place upgrade), they only discovered the problem last week when they tried creating new users, i created 3 test users and the 3 users were getting the above errors. some already existing users have no prob...

Collecting multiple feeds
Folks, I am subscribed to about 30 radio podcast feeds. When I refresh them on any given day, there will be five or six that refresh, and on Friday, there are about twelve. For each one, I click the URL in the feed, which opens the site for that radio program. Then I right-click the link to the podcast and select Save Target As... As it all goes onto the same directory on an MP3 player, I don't have to select it each time, but when the download frame comes up, I have to click the Save button. As most of these programs come from the BBC site, which only allows two si...

Project server 2007 Timesheet creation
Hi, We are using project server 2007. When create a new timehseet, we are facing the following issues. 1. Sometimes the timesheet will be created with all the data filled with the planned hours against the standard row. 1. If we try to add the a new line to the timesheet using Add Lines, it will be added without project name and tasks. Please help me to resolve the issues. Thanks, arun Are you getting add-lines dialog box when you try to add...if your able to see then you shoud select the project task and say ok.hope this helps "Arun" wrote: > Hi, ...

Rounded Corners in Excel 2007 Not Working?!?!
Hi, I can't get rounded corners to work in Excel 2007: I make a chart I right click on Char Area I Select Format Chart Area A Dialogue Box Pops Up with the following Selections: - Fill - Border Color - Border Styles - Shadow - 3-D Format I select fill and fill the chart area with a color .. say blue I right click on chart area again and this time select Border Styles and the following options are available: - Width - Compound Type - Cap Type (drop down menu) - Join Type (drop down menu) - Arrow Settings I click Cap Type and a drop down menu appears with the following options: - Squa...

Form Formatting
I have a subform (datasheet view) in a form where I want to make one column a different color. I can go into Design view and change the color but it doesn't change in the form view. This form was made ages ago with an automatic format and now I can't get away from the automatic format. Help! "DSmith" <donna@DONTSPAMresxrn.com> wrote in message news:eQARsjI6KHA.4508@TK2MSFTNGP06.phx.gbl... >I have a subform (datasheet view) in a form where I want to make one column >a different color. I can go into Design view and change the color but it >doe...

How to add series with VBA?
How can I add multiple series to an existing Excel graph using automation from Access 2000? I'm trying to set up a loop that will define the Xvalue and YValue for each series, but not sure how. I'm creating up to 100 Excel worksheets at a shot with data from Access 2000, and each worksheet needs to have a graph with multiple series. The worksheet creation loop looks like this: For i = 1 to sn.Count db.Execute "SELECT * INTO [Excel 8.0;Database=" & strXlsPath & "].[" & _ strSheetName & "] FROM tblExcelData", dbFailOnError Next Then ...

Outlook 2007 "profile"
Frustrating. When I open Outlook 2007, the program displays a "Choose Profile" screen (with only one option, called Outlook). This is rather new, and I don't know what I did to cause this. I simply want Outlook to open normally without this Profile screen. Any thoughts or comments? By the way, I did check the block that says to make this profile the default -- that didn't help. Thanks. EW Open the mail applet in the control panel. Select show profiles button. Your after the settings at the bottom of the dialog. "Lone Star" <ewyatt_del_me-@excit...

telnet client in access form
Hello. I am trying to creat a form for work that involves connecting to a telnet server to automatically send and retreive specified data. I am new to VB and I am not sure why my code is not working... anybody help me out? Here is the code that seems to be generating the error: Private Sub Form_Open(Cancel As Integer) telnet.RemoteHost = "HOST" telnet.RemotePort = 23 End Sub (obviously i have replaced removed the host name since i am posting this) ...