Hi
Bit of a beginner so bear with me.
I am trying to do something very basic and cannot quite see what I am doing wrong so any help would be appreciated.
I have a public sub routine which requires parameters to be passed to it when I call it from an access form. When I try to enter the code to call the sub I get a compile error. It really seems quite simple so I am sure someone can tell me where I am going wrong. I've also tried calling it from another sub in the same module but get the same compile error - see below.
Thanks for any help.
Bit of a beginner so bear with me.
I am trying to do something very basic and cannot quite see what I am doing wrong so any help would be appreciated.
I have a public sub routine which requires parameters to be passed to it when I call it from an access form. When I try to enter the code to call the sub I get a compile error. It really seems quite simple so I am sure someone can tell me where I am going wrong. I've also tried calling it from another sub in the same module but get the same compile error - see below.
Code:
Sub EmailData(Datafile As String, To_mail As String, CC_mail As String, Subject_mail As String)
'code to use variables passed in
End Sub
Sub Test()
Dim MTable As String
Dim To_m As String
Dim CC_m As String
Dim Subj_mail As String
MTable = "MH_Email_Data"
To_m = "emailaddress1"
CC_m = "emailaddress2"
Subj_mail = "Today's helpful report"
EmailData(MTable,To_m,CC_m,Subj_mail)
End Sub
Thanks for any help.