-
Hi,
I'm changing some code a friend wrote for me. Unfortunately she's gone to Spain. She wrote the code with a picture box in mind, but I'm changing it to a textbox - makes more sense.
In a command button I have:
Command1_Click()
Text1 = "We are being asked to find the value of 'x'." & _
"Firstly, we have to tidy up the left side of the equation,"
qShow
End sub
This then calls the function, qShow
It works fine for the code as a Picturebox:
Sub qShow()
If b < 0 Then Pictext.Print Trim$(a); "(x" & Trim$(b) & ")" _ Else: Pictext.Print Trim$(a); "(x+"; Trim$(b); ")"
End Sub
But if I change Pictext.Print to Text1.Text, I get the following error:
Compile Error: Expected: End of Statement, and ";" is highlighted. Could someone please tell me how to sort this out?
Thanks a lot!
-
not sure if I get what you are after
but you should change pictext.print to text1.print
-
With all due respect, Joe, the textbox does not have a Print method, so you can't say Text1.Print ...
Chris, what you want to do is convert the semicolons to ampersands so that you can display a concatenated string. (In the Print method, the semicolon means "print the following item adjacent to the previous item". To achieve the same results with a textbox, you must concatenate.)
Try this:
Sub qShow()
If b < 0 Then
Text1.Text = Trim$(a) & "(x" & Trim$(b) & ")"
Else
Text1.Text = Trim$(a) & "(x+" & Trim$(b) & ")"
End If
End Sub
[Edited by BruceG on 05-30-2000 at 01:05 PM]