Compile error, user-defined type not available

hcabs99

Active Member
Joined
May 9, 2006
Messages
257
Get the above error message when trying to run some automated emails out of access
It highlights this bit : "MySet As ADODB.Recordset "


Code


Function SiteMail()

Dim MySet As ADODB.Recordset


Set MySet = New ADODB.Recordset
MySet.Open "SiteEmail", CurrentProject.Connection, adOpenStatic

Do Until MySet.EOF
[Forms]![Main].[QSite].Value = MySet![Site]
[Forms]![Main].[QSiteEmail].Value = MySet![SiteEmail]




' DoCmd.SendObject acQuery, "SendToSite", "MicrosoftExcel(*.xls)", [Forms]![SendFile].[Qemail], "", "", "RCA Data", False, ""

DoCmd.SendObject acQuery, "SendSiteEmail", "MicrosoftExcel(*.xls)", [Forms]![SendFile].[QSiteEmail], "", "", "DM Investigation Service Failures [ACTION]", "There are service failures to be coded , Please click the link below to update these. http://intranet.csplc.org/mywork/BICustLog/Development/Lists/RCA/Demand%20Managers%20View.aspx?ShowInGrid=True&View=%7B31AB0392%2D4504%2D4A44%2DA45A%2D0F15EC44CDA5%7D" & vbNewLine & vbNewLine & "Please note that the attached spreadsheet is for information only.", False, ""
MySet.MoveNext
Loop

End Function



Any ideas? Ive used this functionality before in another database and i seem to recall having this issue once before, but i cant remember how i got round it

Cheers
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Alt+f11 to open the VB Editor, Tools-References, locate and check the Microsoft ActiveX Data Objects library reference.
 
Upvote 0
Alt+f11 to open the VB Editor, Tools-References, locate and check the Microsoft ActiveX Data Objects library reference.

Yes, perfect, cant believe it was so simple...i do remember that now from last time..!!

Many thanks for that!!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

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