Does anyone know how to store the results from an sql statement in vb code in a variable. The resluts from the query are going to change based upon what the user chooses on my form??
Look up the database functions in Help (DMax, DCount, DSum, etc.). I'm sure that they will be what you're looking for. If you don't think that they are, please post example SQL.
If your WHERE clause will limit it to one record, then you can use DMax. Give it a try - if it doesn't work, show me what you tried and I'll see if I can help.
It is a database function (maybe look up Database functions in Help - I was able to find DMax when I opened Help and used the Index - I typed in "DMax" and the word was there). If you still can't find it, try this:
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.