Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    2

    Question Unanswered: change the sql-quary from within VB

    My problem is that I need to change a quary from within the Visual Basic code, the quary is called Qry_Special.

    But I don't know how to relate to the quary.

    Anyone got an idea?

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: change the sql-quary from within VB

    Originally posted by carlsson
    My problem is that I need to change a quary from within the Visual Basic code, the quary is called Qry_Special.

    But I don't know how to relate to the quary.

    Anyone got an idea?
    Dim db as Database
    Dim qry as Querydef
    Dim strSQL as String


    strSQL = "Select ......" 'this is your new sql that your query needs
    set db = currentdb()
    set qry = db.querydefs("qry_special")
    qry.sql = strsql


    The code above will feed an SQL string to your query.

    Hope that this works ...
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    2
    Thank you mona

    Had some problems finding out about DAO but now it runs smootly and beutiful.

    /carlsson

Posting Permissions

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