By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

Functions

P: 5
I am trying to call a function that has multible varibles. But when I call the function it errors "expecting =" Am I missing something?

Public Function EMail(EmailAddress As String, EmailSubject As String)

Form_frmEmailSend.Visible = True
Form_frmEmailSend.lblContactEmail.Caption = "" & EmailAddress & ""
Form_frmEmailSend.lblEmailSubject.Caption = "" & EmailSubject & ""

End Function

Calling part

SystemFunctions.EMail (me@gmail.com, Hello)
Jan 4 '08 #1
Share this Question
Share on Google+
4 Replies


Megalog
Expert 100+
P: 378
Try:
SystemFunctions.EMail ("me@gmail.com", "Hello")

String values need quotes.
Jan 4 '08 #2

P: 5
I have tried that too. It is within the VB Editor that it is giving me the error. "Compile error: Expected: = " is what I get when I go to the next line.
Jan 4 '08 #3

Megalog
Expert 100+
P: 378
Assumine the object info is correct, I'd think this would work:

Expand|Select|Wrap|Line Numbers
  1. Public Function EMail(EmailAddress As String, EmailSubject As String)
  2.  
  3. Form_frmEmailSend.Visible = True
  4. Form_frmEmailSend.lblContactEmail.Caption = EmailAddress
  5. Form_frmEmailSend.lblEmailSubject.Caption = EmailSubject
  6.  
  7. End Function
Calling part

Expand|Select|Wrap|Line Numbers
  1. SystemFunctions.EMail ("me@gmail.com", "Hello")
Jan 4 '08 #4

P: 5
Ty for your help, I did two things to fix this.

1 - Added the " back
2 - Changed the call from

SystemFunctions.EMail(me@gmail.com, Test)

to

EmailSent = SystemFunctions.EMail("me@gmail.com", "Test")

Now it works.
Jan 4 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.