Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Display results of select query (Access (All))

    It seems that this should be easy to do, but I somehow I can't see it!

    I have a table in which one of the fields contains an SQL select statement (it is used to configure a combo box "on-the-fly"). On the form that maintains this table, I want to put a little "Test" button next to the control that contains the SQL statement, so that the user can test that there are no errors and that it returns something. I would essentially like to do an OpenQuery, but there is no named query to run, only the SQL statement. (I could create a permanent named query and then just change the SQL property each time, enabling me to use the OpenQuery method; but that's a last resort).

    Liked I said, it seems like it should be easy to do, but how?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Display results of select query (Access (All))

    If you have a copy of the Access Developer's Handbook take a look at the stuff on the CD - there's an add-in named SQLScrat.mda that seems to do something like what you are looking for. In addition to several class modules, etc, there's a form named frmSQLScratchpad that as name implies lets you run quick test to see if SQL statement returns expected results. See attached pic, tested with Northwind "Customers" table. You could always write your own utility to do this, but why invent wheel? (Note: this add-in was included on CD-ROM with the A2K version of ADH, don't know about other versions of book.)

    If you don't have a copy of the ADH, you should!

    HTH
    Attached Images Attached Images

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Display results of select query (Access (All))

    Thanks, I'll give it a look. I don't think I have ADH2000, though I do have it for a couple of earlier versions. I always thought they should offer a discount to "upgrade" to the latest version, but apparently not too many publishers think this is a good idea! go figure. Anyway, I'll see if it is in the earlier versions. Seems like it should be a simple command or something that is readily available.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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