I meant to the value inside of the text box. In your example, do something like:
AutomationLetterWordDemo.txtCustomerName.Text = Chr(34) & AutomationLetterWordDemo.txtCustomerName.Text & Chr(34)
Where Chr(34) is the double quote character.
But, if you just need to have a variable field name from the recordset just play with the actual field name and put that in the variable:
myField = "ReplaceFieldName"
y = Rs.Fields(myField).Value
>I tried this
>
>Dim oSC As ScriptControl
>Set oSC = New ScriptControl
>oSC.Language = "VBScript"
>Dim y As String
>y = "AutomationLetterWordDemo.txtCustomerName.Text"
>y = oSC.Eval(y)
>
>and this
>
>Dim oSC As ScriptControl
>Set oSC = New ScriptControl
>oSC.Language = "VBScript"
>Dim y As String
>y = "AutomationLetterWordDemo.txtCustomerName.Text"
>y = oSC.Eval("y")
>
>and this
>
>Dim oSC As ScriptControl
>Set oSC = New ScriptControl
>oSC.Language = "VBScript"
>Dim y As String
>y = oSC.Eval("AutomationLetterWordDemo.txtCustomerName.Text")
>
>All three produce null strings ( "" )
>
>AutomationLetterWordDemo.txtCustomerName.Text is a valid control on the form on top of the code.
>
>
>
>Where is need to go with this is to get a value from a recordset, using something like this...
>
>Dim oSC As ScriptControl
>Set oSC = New ScriptControl
>oSC.Language = "VBScript"
>Dim y As String
>y = oSC.Eval(rstReplaceCodes.Fields("ReplaceWithFieldName").Value)
>
>where rstReplaceCodes.Fields("ReplaceWithFieldName").Value is equal to another value in a record set ( "rstSQLResultSet.Fields("ColumnName").Value" )
>
>Thanks
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only