Results 1 to 6 of 6

Thread: Query VBA

  1. #1
    Join Date
    Mar 2004
    Posts
    9

    Unanswered: Query VBA

    Hi there. Can I place VBA code into a query. I have a query in my access 2000 mdb. In that query I have an "ON HAND" field. I would like to change the background color of that field if the quantity is below 0. Can I do this????
    Sharon))

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    that's 2 different questions!

    Can I place VBA code into a query....? very often yes, but there are limitations.

    ...I would like to change the background color of that field... not possible in a query-return far as i know.
    but yes in a form or report looking at the query: search this site for "conditional format"

    in extremis, you can sort of fake it in a query SELECT blah1, blah2, iif([ON HAND] < 0, "OUT OF STOCK", "") AS FlagOutOfStock FROM ....

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2003
    Posts
    268

    Datasheet

    If you displayed the query on a form and used Datasheet as the display mechanism couldn't you set the background color conditional based on the results in the respective textbox?

  4. #4
    Join Date
    Mar 2004
    Posts
    9
    Can I make the text Bold in the query. If yes where to I go to enter the expression?? Do I go into the Design view of the query and then the Criteria section??

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    no

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Dec 2003
    Posts
    268

    Suggest Again

    I would again suggest using the query results as a datasheet in a subform then applying the conditional rules you want.

Posting Permissions

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