Results 1 to 2 of 2
  1. #1
    BobW2961 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2016
    Posts
    16

    form background based off of contents of a field

    In form view, I would like my form background to change based on the contents of one of the fields as I arrow through the records.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This can be done with VBA code in the form's Current event. Examples:

    Code:
    Private Sub Form_Current()
    If Me.somefield = "this value" Then
        Me.Picture = "C:\Images\Image1.png"
    Else
        Me.Picture = "C:\Images\Image2.png"
    End If
    End Sub
    Referenced field has name of image file:
    Code:
    Private Sub Form_Current()
        Me.Picture = "C:\Images\" & Me.ImageName
    End Sub
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-05-2016, 08:12 AM
  2. Replies: 7
    Last Post: 06-26-2014, 01:41 PM
  3. Replies: 2
    Last Post: 08-14-2013, 04:29 PM
  4. Replies: 0
    Last Post: 03-29-2011, 04:11 PM
  5. Replies: 2
    Last Post: 02-25-2011, 03:56 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