Code problem

Nero

New Member
Joined
Mar 5, 2002
Messages
27
Hi,
I have a command button with code behind it which retrieves data from an MS Access database and returns it to a worksheet using MS Query.The query retrieves data that is relevent to a specific date. If I edit my code and add the date that I want to use the query works fine.
What I am trying to do is by means of an input box the user to enter the date they wish to use in the query.
The code will then use the date entered into the variable to run the query. The code keeps crashing when it uses the variable.
When I revert to entering the date directly into the code it works fine again.
Could anyone tell me what I am doing wrong??
 
Thanks Tom
Sorry for the delay I have only just checked the board again.
I will try your suggestion tomorrow and post back.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Tom,
Tried it but still not working.
Thanks for all your help, I will keep trying to crack it.
 
Upvote 0
Well, good luck, Nero. A few years ago, I did what you're trying to do. It took a little tinkering with the concatenation and punctuation, but I did get it to work. It's just a bit hard to debug, remotely, without the interfacing database and such.
Tom
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top