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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling sub routine that links VBA to Lotus Notes

Status
Not open for further replies.

HaydenMB

IS-IT--Management
May 30, 2003
24
GB
Hi,

I have a sub-routine in a database (Access 2000) that I am working on that automatically sends an email with an attachment via Lotus Notes. The sub-routine works fine if I do not call it from anywhere else but declare the variables within the routine..

I am trying to make the procedure more dynamic sending multiple emails to multiple suppliers at the click of a button so I am trying to call the subroutine from a form and passing the variables from there.

Here is the header from the sub-routine I want to call;

Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean)

But when I try to call the routine from my form I keep getting a Compile Error message saying; "Expected: ="

Here is how I am calling the routine;

SendNotesMail(strSubject, strAttachment, strRecipient, strBody, blnSave)

What I have worked out is that it wants the = sign at the beginning of the line. But I am not sure what goes before the = sign or if I should be putting an = sign there.

Can anybody help me please?

Much appreciated

Hayden
 
try

CALL SendNotesMail(strSubject, strAttachment, strRecipient, strBody, blnSave
 
OPps, if you are trying to embed this in the properties of a form, it needs to be a function not a subroutine.


 
Thanks the Call procedure worked great.

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top