Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!
Or try our Ask An Expert service to answer any of your questions!
I got this to work..but when i created a macro to call the function, and tried to run it, Access does not recognize it. I believe the error msg was The expression you entered has a function name that the file name doesnt recognize.
The module name and function aren't the same; I know that macro will NOT call a function if they are the same. Does anyone have any idea?
Originally posted by HoustonGal
I created a sub in module, but I am having problems writing a function to call it. I think I am a VB idiot Please help!
This is the sub code..How do I write a function to call it so that I can use the function in a macro?
Dim OutlookObj As Outlook.Application
Dim Nms As Outlook.NameSpace
Dim Mail As Outlook.MailItem
Set OutlookObj = CreateObject("Outlook.application")
Set Nms = OutlookObj.GetNamespace("MAPI")
Set Mail = OutlookObj.CreateItem(0)
Mail.Subject = "this is a test"
Why even fool with a macro? Convert your macro to a Module, name that module something like SendMail() then call that macro from your function, IF you already know the macro will send the mail. Check online help for sending mail in access via outlook, using the SendObject action.