Results 1 to 4 of 4
  1. #1
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40

    Conditional Formatting to Change Background Colour

    I have a control on a Form called 'Invoice' that can contain Text or a Number, the Form is displayed in Datasheet View. When viewing the datasheet and need to see immediately if the 'Invoice' field contains text, so I am trying to make it stand out by setting the background to a different colour if does contain text. I tried using Conditional Formatting to achieve this but, I don't know the correct 'Expression Is' to use. Can anyone help me with this, or advise me of a better way to do it? Thanks in anticipation

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you are just looking for the existence of an entry, one way is to use the LEN function, i.e.
    Code:
    LEN([FieldName])>0

  3. #3
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40
    Quote Originally Posted by JoeM View Post
    If you are just looking for the existence of an entry, one way is to use the LEN function, i.e.
    Code:
    LEN([FieldName])>0
    No, the entries are no problem, what I want is for the background colour to change if the entry is text, and remain 'normal' if the entry is a number. The vast majority of data entries in the Invoice control are numbers, however, sometimes there is text in there (such as "awaiting invoice #", or "credited" etc). When viewing in Datasheet view, I want the control to stand out if the data is text by changing the background colour, I thought the best way might be to use Conditional Formatting? Sorry if this wasn't clear in my first posting.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Check out the IsNumeric function (http://www.techonthenet.com/access/f.../isnumeric.php).
    You should be able to use this in your Conditional Formatting to do what you want.

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

Similar Threads

  1. Background colour when Form centered
    By jcc285 in forum Forms
    Replies: 4
    Last Post: 03-13-2015, 12:43 PM
  2. Replies: 16
    Last Post: 12-02-2013, 06:20 AM
  3. subform background colour
    By gbmarlysis in forum Forms
    Replies: 1
    Last Post: 03-03-2012, 10:18 AM
  4. Replies: 18
    Last Post: 09-30-2011, 06:41 AM
  5. Change the colour of a form background
    By r_e_v_a_n_s in forum Forms
    Replies: 0
    Last Post: 11-15-2005, 03:39 AM

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