Queries Using A Form

notoca

New Member
Joined
Sep 8, 2003
Messages
37
Hi

I've been searching the archives for an example of how to use a form to capture user input for a query. I found an example and pulled it to pieces to find out what it was doing. I was even able to follow some of the VB code amd I learnt a few things. So, feeling a little confident I started to build a query form based on the example.

It's complete and almost works properly. The program falls over when it comes to the following dim statements:

DIM db as DAO.Databases
DIM qdf As DAO.QueryDef

The message I get is "User Defined Type Not Defined." These were in the code of the example and they worked fine with the example. However, in my project the query form falls over at this point. I looked through the example vb code trying to find references to DAO but couldn't find anything. There is something in the example program that I have missed. Does anyone have any ideas.

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,221,623
Messages
6,160,889
Members
451,676
Latest member
Assy Bissy

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