Results 1 to 6 of 6
  1. #1
    Datamulcher is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2016
    Location
    Victoria, Canada
    Posts
    26

    Question Conditional Formatting Greyed Out; Do not know why?


    I have made a productivity form with a field which displays the trend as either "Down" or "Up!".
    I would like it to be conditionally formatted to GREEN if UP and RED if DOWN, but the conditional formatting button is greyed out for this field.
    [note- it is greyed out for all fields except for the date field...]

    The box is a ListBox, pulling data with Row Source: SELECT [qDB_Trend].[Trend] FROM qDB_Trend ORDER BY [Trend]; and RowSourceType of Table/Query.

    I have scoured the internet but there are no answers I have found. The only thing I have found out is that ListBoxes apparently are not able to be conditionally formatted.
    I tried using a ComboBox and it will display the data, buuuuuuuuuuuut cannot apply CF to this either!

    I am still learning so have mercy, I tried using other box types, but these do not have a "Row Source" field, only a control source - and placing the above SELECT statement in these either gives me a #NAME error or just blank.

    So- A) Can I apply CF to a listbox? B) if not, how can I use another type of box to display the data from a query as above?

    Thanks in advance!!

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    As this box only contains one value, it need not be a listbox (which displays a list of items). This also sounds like a display field, not one that the user selects - is that right? In that case you could have 2 label fields, one red and one green, and make them visible/invisible for whichever value is being displayed.

  3. #3
    Datamulcher is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2016
    Location
    Victoria, Canada
    Posts
    26
    Yes you're right, it is only a display field.

    The reason I have it as a listbox is that if I ask another type of box to display the data from SELECT [qDB_Trend].[Trend] FROM qDB_Trend ORDER BY [Trend]; (the value from the query I want displayed) it just displays either blank or NAME#. I'm relatively new to Forms so I don't know the criteria for the use of the different box types well.

    I do not know what you mean by "have 2 label fields, one red and one green, and make them visible/invisible for whichever value is being displayed." - sounds good, but how is that implemented?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What is the record source for your form? If you join this query to it then it will be a textbox bound to the record source. Then you can set the conditional formatting.

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    If the info isn't in your record source (and you can't add it) you could use a dlookup statement

    Dlookup ("trend","qdb_trend", criteria)

    This would put the up or down in a textbox and you could use conditional formatting from there.


    Sent from my iPhone using Tapatalk

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by Datamulcher View Post

    The reason I have it as a listbox is that if I ask another type of box to display the data from SELECT [qDB_Trend].[Trend] FROM qDB_Trend ORDER BY [Trend]; (the value from the query I want displayed) it just displays either blank or NAME#.
    That's correct! andy49's suggestion is the only way to display a value from a Query in a Textbox...you can't simply assign it with a Query/SQL Statement.

    Linq ;0)>

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

Similar Threads

  1. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  2. conditional formatting
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 07-14-2014, 10:26 AM
  3. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  4. Conditional Formatting
    By mm07nkb in forum Forms
    Replies: 1
    Last Post: 09-02-2011, 09:58 AM
  5. Conditional Formatting
    By cevatyildiz in forum Forms
    Replies: 8
    Last Post: 04-30-2010, 12:01 PM

Tags for this Thread

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