Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    34

    Unanswered: Display Query Result in a Textbox

    Hi Everyone,

    Does anyone know how to display the result of a query in a text box on a form?

    Thanks,
    Schoon

  2. #2
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Re: Display Query Result in a Textbox

    Originally posted by Schoon Dog
    Hi Everyone,

    Does anyone know how to display the result of a query in a text box on a form?

    Thanks,
    Schoon
    Just a brain storm here but try

    text_box.value = docmd.sql "query"

    see what that does for you

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    maybe you should clarify "the result of a query" ...in general, the result of a query is a bunch of records: multiple records are not going to sit happily in a text box.

    if you are concerned with a count, sum, max, min, average, first, last, etc etc etc of a bunch of records try:

    Control Source = DAvg("[fieldInQuery]", "nameOfQuery")

    .value = null if no records returned.

    ...DCount, DSum, Dmax, DMin, DStDevP, etc etc all work in the same way

    ...check help for the difference in null-field handling between * and namedField




    izy
    (...is addicted to domain aggregate functions!)

Posting Permissions

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