Results 1 to 3 of 3
  1. #1
    Sparky is offline Novice
    Windows 7 Access 2003
    Join Date
    Nov 2010
    Posts
    6

    Query Field Formatting

    I've tried to format a field in a query so that if a date is present it is formmatted as mm/dd/yyyy and shows in magenta and if the field is null (not yet populated) then it shows as blue. I've tried the following:

    (mm/dd/yyyy hh:nn ampm)[Blue];@;"Sched"[Magenta]

    but this shows date in blue properly formatted but nothing in the empty date fields.

    If I use

    [Blue];@;"Sched"[Magenta]

    then I get the word Sched where the date is empty, but improper formatting for the date.



    I would like to format these in the query so they will then show this way in a listbox. Currently, the formatting does no carry over to the listbox.

    Thanks for any help.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I think you will find that formatting is *always* ignored in a ListBox. Maybe this link will help: http://www.lebans.com/customlistboxver3.htm

  3. #3
    Sparky is offline Novice
    Windows 7 Access 2003
    Join Date
    Nov 2010
    Posts
    6

    Query Field Formatting

    Thanks RuralGuy. I'd looked at Lebans before, but it seemed to me that he was creating a different control. I thought I had read that if the formatting was part of the query then it would carry over to the list box. So I was interested in what is the proper syntax for getting the formatting right. Seemed like I could get half what I wanted with one version of syntax,the other half with another version. Ideally, I'd like to know where the "rules" for this syntax are. I've often looked at VBA help, but only found a few examples, not the actual rules.

    I've moved to creating the same form with a subform that is a continuous form with text boxes that I can format as I'd like. Still, I'd like to know if it can be done using formatting in the query and a listbox.

    But, thank you for responding and for your reference.

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

Similar Threads

  1. Formatting a Concatenated Field
    By CoachBarker in forum Queries
    Replies: 2
    Last Post: 09-23-2010, 09:12 AM
  2. Formatting formulas
    By katrinanyc926 in forum Queries
    Replies: 2
    Last Post: 08-16-2010, 07:52 AM
  3. Replies: 3
    Last Post: 04-26-2010, 11:38 AM
  4. Formatting a Calculated Field
    By e_lady333 in forum Queries
    Replies: 0
    Last Post: 03-17-2010, 06:11 PM
  5. Need Help Formatting a field.
    By marshallgrads in forum Access
    Replies: 4
    Last Post: 12-06-2007, 03:44 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