[AccessD] Open all forms

Mark A Matte markamatte at hotmail.com
Mon Jul 21 21:07:03 CDT 2008


Rocky,

I think you already solved your issue...but in case not:

This was for reports...but I'm sure you can modify for forms.

Hope it helps...

Mark A. Matte

P.S...of course credit goes to ACCESSD!!!!!!!!

***************START*********************
    Dim obj As AccessObject, dbs As Object
    Dim rpt As Report
    Dim ctl As Control
    Set dbs = Application.CurrentProject
    ' Search for open AccessObject objects in AllReports collection.
    For Each obj In dbs.AllReports

  DoCmd.OpenReport obj.Name, acViewDesign
            Set rpt = Reports(obj.Name)
            str1 = "CurrentUser"
            str2 = "GetUser"
On Error Resume Next
    For Each ctl In rpt.Controls
        If ctl.ControlType = acTextBox Then
             If InStr(1, ctl.ControlSource, str1) Then
                  ctl.ControlSource = Replace(ctl.ControlSource, str1, str2)
            End If         
         End If 
    Next

  DoCmd.Close acReport, obj.Name, acSaveYes

  Set rpt = Nothing
  Set ctl = Nothing
        
        
        
        
    Next obj
***************END*********************


> From: rockysmolin at bchacc.com
> To: accessd at databaseadvisors.com
> Date: Mon, 21 Jul 2008 08:25:57 -0700
> Subject: Re: [AccessD] Open all forms
>
> Thanks Mark. That's what I need - loop through all the forms, then also
> loop through all the controls - I can change the Times font to Arial or
> Tahoma and change the forecolor as well.
>
>
> Rocky Smolin
> Beach Access Software
> 858-259-4334
> www.e-z-mrp.com
> www.bchacc.com
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
> Sent: Monday, July 21, 2008 8:16 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Open all forms
>
>
> Rocky,
>
> I did something similar a few months ago. I searched every form for a text
> box that had a ControlSource LIKE "*MySearch*" and Updated the ControlSource
> to "SomethingNew".
>
> I think this is what you need. I Have it at home and can send it this
> evening (about 3:00 your time)
>
> Thanks,
>
> Mark A. Matte
>
>
>
>
>> From: rockysmolin at bchacc.com
>> To: accessd at databaseadvisors.com
>> Date: Mon, 21 Jul 2008 07:11:26 -0700
>> Subject: [AccessD] Open all forms
>>
>> Dear List:
>>
>> I am trying to write a quick module that will open all the forms in
>> turn in design view, change one property (in this case the background
>> color of the detail section), save and close. But I can't seem to get
>> the syntax right to open each of the forms in turn.
>>
>> Does anyone have a snip to do this?
>>
>> MTIA
>>
>> Rocky Smolin
>>
>> Beach Access Software
>>
>> 858-259-4334
>>
>> www.e-z-mrp.com
>>
>> www.bchacc.com
>>
>>
>>
>>
>>
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>
> _________________________________________________________________
> With Windows Live for mobile, your contacts travel with you.
> http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072
> 008
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
With Windows Live for mobile, your contacts travel with you.
http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008



More information about the AccessD mailing list