micarl@gmail.com wrote:
Quote:
>Thanks for your help!
>
>Is there any way to write code to make sure users
>have a reference to the DAO object library?
Just add the DAO reference. Note though that if you're using ADO you can also create
a ADO recordset.
If You're using Access 2000 or newer and you have references to both DAO (Microsoft
DAO 3.6 Object Library or newer) and ADO (Microsoft ActiveX Data Objects 2.x Library)
When you have both references, you'll find that you'll need to "disambiguate" certain
declarations, because objects with the same names exist in the 2 models. For example,
to ensure that you get a DAO recordset, you'll need to use Dim rsCurr as
DAO.Recordset (to guarantee an ADO recordset, you'd use Dim rsCurr As
ADODB.Recordset)
The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
Quote:
>Having to adjust the references on users access probably isn't ideal?
DAO is fine as it's on everyones machine who has Access installed.
Quote:
>Also, if i have this running based on selections from a multiselect
>picklist on a form, would i be best to copy this code to a module and
>have the vba code run through the selections, then the module? or
>would i be best to combine the code for the selections then run this?
You might as well leave the code behind the form if it's only going to be used on
that form and is form specfiic.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/