Access VBA Statement (Access 2000 - Vb 6.0) "Dim MyDB As Database"

G

Guest

I am trying to implement Article ID 31881 -How to use a record set to send
Outlook e-mail to multiple receipients in Microsoft Access.

I have copied the code suggested into a new module. However the compiler
does not like the first statement. (Access 2000, VB 6.0)

Dim MyDB As Database

The second statement is accepted!

Dim MyRS As Recordset

It looks like the "As Database" is not acceptable.

Can anyone help me as to what is incorrect in VB
 
D

Dave Patrick

Open any code module, Tools|References and make sure the box is checked for
'Microsoft DAO 3.6 Object Library'

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| I am trying to implement Article ID 31881 -How to use a record set to send
| Outlook e-mail to multiple receipients in Microsoft Access.
|
| I have copied the code suggested into a new module. However the compiler
| does not like the first statement. (Access 2000, VB 6.0)
|
| Dim MyDB As Database
|
| The second statement is accepted!
|
| Dim MyRS As Recordset
|
| It looks like the "As Database" is not acceptable.
|
| Can anyone help me as to what is incorrect in VB
|
 
G

Guest

Thank You - Solved the Problem. Suggest you add this to your next update to
Article ID # 31881 for us amateurs.
 
D

Dave Patrick

Glad to hear it. Thanks for the feedback. There's a place at the bottom of
the article where you can make the suggestion.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Thank You - Solved the Problem. Suggest you add this to your next update
to
| Article ID # 31881 for us amateurs.
 
D

Douglas J. Steele

Just a comment. It's not quite as simple as that.

If you're not going to be using ADO, uncheck the reference to Microsoft
ActiveX Data Objects 2.1 Library when you add the reference to DAO.

If 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


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Henry Jordan said:
Thank You - Solved the Problem. Suggest you add this to your next update
to
Article ID # 31881 for us amateurs.

Dave Patrick said:
Open any code module, Tools|References and make sure the box is checked
for
'Microsoft DAO 3.6 Object Library'

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| I am trying to implement Article ID 31881 -How to use a record set to
send
| Outlook e-mail to multiple receipients in Microsoft Access.
|
| I have copied the code suggested into a new module. However the
compiler
| does not like the first statement. (Access 2000, VB 6.0)
|
| Dim MyDB As Database
|
| The second statement is accepted!
|
| Dim MyRS As Recordset
|
| It looks like the "As Database" is not acceptable.
|
| Can anyone help me as to what is incorrect in VB
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top