Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Email "Dim As ..." doesn't recognise 'Database' object - why?!?

Status
Not open for further replies.

domk

Technical User
Nov 20, 2001
6
0
0
GB
I am trying to set up a batch email command button but the debugger stalls on the first line of code below. It also doesn't like the "Set db = CurrentDb" line. I am using Access2000 and VB6.

Does anyone have any idea what's going on here?!

Dom from UK
____

Dim db As Database, rst As Recordset
Dim Names As String

Set db = CurrentDb
Set rst = db.OpenRecordset("MDCorpEnt", dbOpenDynaset)

With rst
.MoveFirst
Names = ! & ";"
.MoveNext
Do Until .EOF
Names = Names & ![email] & ";"
.MoveNext
Loop
End With

rst.Close

DoCmd.SendObject acSendReport, "jobopps", acFormatRTF, Names, , , "Current Job Opportunities for Classified Personnel", , True
 
try your tools and references. Make sure that DAO 3.6 is selected. Then decalre your vars as:

dim db as database
dim rst as dao.recordset Hope this is ok. If not, just let me know.

Nick (Everton Rool OK!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top