Results 1 to 4 of 4
  1. #1
    Giewont90 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    2

    Setting color in SQL query

    Hello everyone !
    I have a problem with a task to my "Database Systems" classes at my University.
    The task is :
    To create the query which result is : printing names of students in blue color.

    I was trying like this :
    Code:
    SELECT Format(Students.[Name],"[blue]")
    FROM Students;
    But it doesn't work - names are still black.
    I must do it using only SQL, not properties of table.
    Is it possible ?

    Sorry for my English.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Don't think can build into the SQL statement. Use properties of query. With Access query in Design View, select column, and in the Properties window, enter this in Format property: [Blue]@. Works only with text data. Number type would have to be converted, CStr([number field]). Now view the query in SQL view, the format parameter does not show in the statement.

    This can be done with table or query. Do it in table and the property will carry over to query.
    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
    Giewont90 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    2
    Yes, I know this way of solving problem. But I was curious, if it is possible through SQL code.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Apparently not. If Access doesn't build it into the SQL string, then don't see how could build it in a VBA coded SQL string. However VBA code might be able to change this Format property of the saved Access query.
    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. Change font color in Query
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 01-10-2013, 09:14 PM
  2. Replies: 1
    Last Post: 11-01-2010, 06:59 PM
  3. VBA setting parameter to append query
    By rpiller in forum Programming
    Replies: 1
    Last Post: 09-30-2010, 04:02 PM
  4. Setting a Color on a Control For Error
    By AccessLes in forum Programming
    Replies: 6
    Last Post: 06-16-2010, 12:35 PM
  5. Replies: 5
    Last Post: 10-08-2009, 05:15 AM

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