Text Box Value without " " while calling a function

Ksabai

Registered User.
Local time
Today, 11:30
Joined
Jul 31, 2017
Messages
104
Iam Calling a function in a form using value of the TextBox. But invariably the Text Value is Shown as "Forms!Contracts!lstBox" but i want to display as Forms!Contracts!lstBox only.

Need Someones help here
 
I don't really understand any of that. Post your procedure code.
 
Call SendCDOMail(Me.txt_To, Me.txt_Subject, Me.txt_Msg, Me.txt_Cc, Me.txt_Attach)

Me.txt_Attach value is "Forms!Contracts!lstBox"
 
I expect you are trying to pass the name of a listbox referred to in Me.txt_Attach then use the value in that listbox inside your function.

The Eval() function can be used for this. Apply it to the parameter inside the function.
 
can you send its Value. also attachments should are Variant so you must use Variant on your function/sub declaration:

Call SendCDOMail(Me.txt_To, Me.txt_Subject, Me.txt_Msg, Me.txt_Cc, Me.txt_Attach)


Public Function SendCDOMail(txt_To As String, txt_Subject As String, txt_Msg As String, txt_Cc As String, txt_Attach As Variant)
 

Users who are viewing this thread

Back
Top Bottom