Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Passing a Param value from Vba to an access Qry

    I have a qry in access that takes a paramater, this paramater is then used over a sequence that takes about 1/2

    I would like to ask with a vba input box for the param and then keep passing the variable for that param to the querys that run as required instead of continually requesting for the same value.

    The code in vba will assign a date to a variable

    dim lastDownLoad as date

    lastDownLoad =inputbox(yada yada yada)

    docmd.openqry lastdownload <-- some thing like this is what im looking for,, i have already set the paramater up in the querry


    TKS

    M~

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Your form calls this query? If so why not mod the query to pull the date from the form ...

  3. #3
    Join Date
    Oct 2003
    Posts
    311

    having the query pull parms from a form

    Originally posted by M Owen
    Your form calls this query? If so why not mod the query to pull the date from the form ...
    How do i do that?

    M~

  4. #4
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    You can use DAO to pass parameters to a query:

    dim db as dao.database
    dim qdf as dao.querydef
    dim prm as parameter

    set db = currentdb()
    set qdf = db.querydefs("YOUR QUERY NAME")

    for each prm in qdf.parameters
    prm.value = eval(prm.name)
    next prm
    Access XP & WinXP Pro

Posting Permissions

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