Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional formatting in datasheet view (Access 2002 / VB 6)

    I have an unbound text box in a form named ListDocs. I populate that unbound text box, on form open, with data (in datasheet view) using the VB code below (based on a query gry_document). Is there a way to put a conditional format on a given row of data from the query (based on a value on the query) in a datasheet type view?

    Me!ListDocs.RowSource = "SELECT DISTINCTROW * FROM qry_document ORDER BY doc_id;"
    Me!ListDocs.Requery

    Thanks
    -Tony

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional formatting in datasheet view (Access 2002 / VB 6)

    If ListDocs has a row source, it is not a text box, but a list box. A list box doesn't make sense in a datasheet form (if that is what you mean), and Access doesn't offer any way to apply special formatting to individual rows of a list box.

    If I misunderstood your question, please provide more info.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting in datasheet view (Access 2002 / VB 6)

    Have you tried selecting the text box while the form is in design view and using the conditional formatting option found under Format > Conditional Formatting?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  4. #4
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting in datasheet view (Access 2002 / VB 6)

    Yes I'm sorry....it is a list box.
    What I mean by datasheet is that it ends up looking like a spreadsheet (or datasheet) when the list box is populated.
    I didn't think there was a way.

    Thanks

  5. #5
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting in datasheet view (Access 2002 / VB 6)

    Yes... I tried just doing it in the design view using conditional formatting. It is not an option with an unbound list box.

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting in datasheet view (Access 2002 / VB 6)

    Then I must agree with Hans. Are there other objects on your form?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •