
Passing user data type to function causes type mismatch error
I have a module that has a public data type declared as follows;
+++++++++++++++++++++
Public Type MailMSG
displayname as string
txt as string
subj as string
confirm as boolean
sender as string
End Type
My function starts as follows
Public Function QuickSend(sMSG as MailMSG)
Stuff in the function
End Function
+++++++++++++++++++++++++
Now I pass the the type as an argument to the function as follows;
+++++++++++++
Sub Send_Click()
Dim mymessage as MailMSG
mymessage.displayname = "Lemon, Philip"
mymessage.txt = "Yadda, Yadda, Yadda"
mymessage.subj = "Test Subject"
mymessage.confirm = True
QuickSend(mymessage)
+++++++++++++
When I call the function using the last line I get a Type Mismatch
error. Why?
Phil Lemon