Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying Access from Excel

Status
Not open for further replies.

emjay653

Technical User
Mar 11, 2004
19
0
0
GB
Hi,

We have an Access database set up, with functioning queries and all works fine. We run a query that prompts the user to insert Start & End dates and it returns the required data.

We would like to run the same query via Excel, however when we try it, it fails at the data prompts. If we put a static date instead of the prompts it works fine.

Tried using VBA to get it to run, with a command button, but can't get the syntax to work. It keeps failing at the connection string.

Can anyone please advise on the correct syntax to use, using VBA, to connect to an Access database from Excel.

TIA
Mj
 
Have you tried recording a macro and the using Data\Get External Data\New Database Query and then querying the Access Database?

Fen
 
Have you tried recording a macro in excel and then using Data\Get external data\New Database Query.... to get the required code?

Fen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top