Text Box Value without " " while calling a function (1 Viewer)

Ksabai

Registered User.
Local time
Today, 08:12
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
 

June7

AWF VIP
Local time
Today, 07:12
Joined
Mar 9, 2014
Messages
5,466
I don't really understand any of that. Post your procedure code.
 

Ksabai

Registered User.
Local time
Today, 08:12
Joined
Jul 31, 2017
Messages
104
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"
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 01:12
Joined
Jan 20, 2009
Messages
12,851
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:12
Joined
May 7, 2009
Messages
19,230
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

Top Bottom