Results 1 to 5 of 5

Thread: Look through all forms in Access Database and set back colour

  1. #1

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Resolved Look through all forms in Access Database and set back colour

    Hi all

    Am trying to loop through all forms in database and set the back colour to a colour.

    Is this possible??

    I code set lead me to only active forms......other code leads me to just list form names in Access Forms Container

    Any ideas???

    cheers George

    VB Code:
    1. Static dbsCurrent As Database
    2.     Dim cntTemp As Container
    3.     Static intCount As Integer
    4.     Dim intCounter As Integer
    5.     Static Objects() As String
    6.     Dim varreturn As Variant
    7.     Dim prp As Property
    8.    
    9.    
    10.     Set dbsCurrent = CurrentDb()
    11.     Set cntTemp = dbsCurrent.Containers("Forms")
    12.     intCount = cntTemp.Documents.Count
    13.    
    14.     ReDim aObjects(intCount) As String
    15.    
    16.     For inCounter = 1 To inCount - 1
    17.         cObjects(intCounter) = cntTemp.Documents(intCounter).Name
    18.         cObjects(intCounter) = cntTemp.Documents(intCounter).Properties.Append     ?????? unsure how to use this
    19.  
    20.     Next intCounter
    Last edited by Ggalla1779; May 24th, 2006 at 06:44 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Look through all forms in Access Database and set back colour

    If you use the Forms collection you will still have to only get access to the forums that are actually open.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Look through all forms in Access Database and set back colour

    yup found that out....is it possible to set all forms in Access database when the user opens to 1 colour for each forms back colour.....

    Can seem to get this to work at all....Access 97 BTW

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Look through all forms in Access Database and set back colour

    You could modify each forms _Load event to set the backcolor.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Fanatic Member Ggalla1779's Avatar
    Join Date
    Feb 2006
    Location
    Glasgow
    Posts
    532

    Re: Look through all forms in Access Database and set back colour

    yup thats what I ended up doing....just thought there would be easier way.

    cheers George

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width