Data Connection From Excel 2007 to Access 2007 Query With Selection Criteria

Hi,
I want to build a data connection between from Excel 2007 to Access 2007 to an Access query that has one selection criteria using vba code.

I would appreciate any help!

Thanks
Gary
tgtg7Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
..to continue, you can then display the result with

     worksheets("sheet1").range("a1").copyfromrecordset rs
0
 
Rey Obrero (Capricorn1)Commented:
you can use codes like this

dim db as dao.database, sql as string, rs as dao.recordset, dbPath as string
dbPath="< complete path to the db >"

    set db=opendatabase(dbPath)
   
    sql="select * from table where <criteria string >"

    set rs=db.openrecordset(sql)

   
what are you trying to do ?
0
 
tgtg7Author Commented:
thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.