How to display the intermediate values

J

Jack

Hi,
I got a test form and testing a small routine. This program takes the , from
a text and shows first name and last name with a space in between. The label
in the form shows the result. I would like to see the intermediate values for
the calculations without creating any label to display. How can I see those
values without creating a label. Thanks in advance.

ROUTINE:
Private Sub cmdCalculate_Click()
Dim intComma As Integer
Dim totlen As Integer

Dim txtFirst As String
Dim txtLast As String
Dim pReturn As Variant

intComma = InStr(txt_Name, ",")
'Debug.Print intComma
totlen = Len(txt_Name)
txtLast = Left(txt_Name, intComma - 1)
txtFirst = Right(txt_Name, Len(txt_Name) - intComma - 1)
UnstringName = txtFirst & " " & txtLast
lblUnstring.Caption = UnstringName
End Sub
 
M

Marshall Barton

Jack said:
I got a test form and testing a small routine. This program takes the , from
a text and shows first name and last name with a space in between. The label
in the form shows the result. I would like to see the intermediate values for
the calculations without creating any label to display. How can I see those
values without creating a label. Thanks in advance.

ROUTINE:
Private Sub cmdCalculate_Click()
Dim intComma As Integer
Dim totlen As Integer

Dim txtFirst As String
Dim txtLast As String
Dim pReturn As Variant

intComma = InStr(txt_Name, ",")
'Debug.Print intComma
totlen = Len(txt_Name)
txtLast = Left(txt_Name, intComma - 1)
txtFirst = Right(txt_Name, Len(txt_Name) - intComma - 1)
UnstringName = txtFirst & " " & txtLast
lblUnstring.Caption = UnstringName
End Sub


You can use Debug.Print or a MsgBox to see it. Or you can
place a break point on the last line of code. You could
also set a watch on the UnstringName variable.

If you want to see the result on the form, then you need a
control capable of displaying a string, e,g, label or text
box.
 
J

Jack

Thanks a lot Marshall. I appreciate it.


Marshall Barton said:
You can use Debug.Print or a MsgBox to see it. Or you can
place a break point on the last line of code. You could
also set a watch on the UnstringName variable.

If you want to see the result on the form, then you need a
control capable of displaying a string, e,g, label or text
box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top