Create and run select access SQL queries through VB

Im attempting to have a user select the table,  fields and criteria to create a SQL statement query and run it immediately, from a form in MsAccess.
Ive tried to build and store the SQL statement in a string, set it as a new querydef,open an existing query and set its sql to the string. I have been unable to get this to work however. I either get a "obj var/ with block var not set" error or invalid SQL statement . However the syntax of the statement is correct according to tutorials ive followed. Can any1 offer sum help


Answer this question

Create and run select access SQL queries through VB

  • Thiago Silva

    I knew that was the right answer all along...

  • sam8sam

    Hi TechAddict,

    I'm glad to help.  However, I'm not quite sure how you're approaching this and can't really answer yet.

    Could you share some of the key code and stored procedure SQL that you're trying, and point out where it's popping an error

    thanks,
    Paul

  • Create and run select access SQL queries through VB