Results 1 to 3 of 3
  1. #1
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407

    Question datasheet fill color changes


    Hi, I'm trying to change the fill color for a datasheet subform and it's not working. If I open the form normally I can change the fill color using the menu.

    My questions are -
    Can i change the fill color of the datasheet in single form mode using VBA
    Can I also change this using VBA if it's a subform datasheet

    My problem is the system I am developing is for 2 companies in the same office, each with thier own colors, the customers form is currently on a tab page (in datasheet view) with all employees listed, I will use a combo box to select the company and list only employees for that company, but would also like to change the fill color as well. If I have to I can use a standalone form on top of the tabed menu system I have.
    I am doing this so it's obvious which company is selected throughout the tabed menu system

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    This worked for me:

    Private Sub Detail_Paint()
    Me.Detail.BackColor = vbRed
    End Sub

    Probably want to set AlternateBackColor to No Color.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    thaks for that, I did find Me.Detail.BackColor, and I just worked it out -
    Me.Employees1.Form.DatasheetBackColor = DLookup("[form color]", "[application data]", " [company title] = forms![main menu]![combo1290] ")
    will change the datasheet backcolor for a subform datasheet view

    Thanks for you help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2013, 04:11 PM
  2. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  3. Replies: 4
    Last Post: 05-04-2012, 03:41 PM
  4. Replies: 6
    Last Post: 04-14-2010, 11:03 AM
  5. Auto-fill in datasheet
    By Terence in forum Database Design
    Replies: 2
    Last Post: 03-18-2010, 03:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums