I have this code, try this
Private Sub Command1_Click()
Command3.Enabled = True
Label15 = Val(Text3.Text) * Val(Text4.Text)
Label16 = Val(Text5.Text) + Val(Text6.Text)
Label14 = (Val(Text3.Text) * Val(Text4.Text)) - (Val(Text5.Text) + Val(Text6.Text))
Label10.Visible = True
Label11.Visible = True
Label12.Visible = True
Label13.Visible = True
Label14.Visible = True
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Unload Form1
Form1.Show
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Label11 = Text1.Text
If IsNumeric(Chr(KeyAscii)) Then
MsgBox "Enter Letters only", vbCritical, "Error"
KeyAscii = 0
End If
End Sub
Private Sub Text2_Change()
Label13 = Text2.Text
End Sub
Private Sub Text3_Change()
If Not IsNumeric(Text3.Text) Then
MsgBox "Enter Numbers only!", vbCritical, "Error"
Text3.Text = ""
End If
End Sub
Private Sub Text4_Change()
If Not IsNumeric(Text4.Text) Then
MsgBox "Enter Numbers only!", vbCritical, "Error"
Text4.Text = ""
End If
End Sub
Private Sub Text5_Change()
If Not IsNumeric(Text5.Text) Then
MsgBox "You must enter a number!", vbCritical, "Error"
Text5.Text = ""
End If
End Sub
Private Sub Text6_Change()
Command1.Enabled = True
If Not IsNumeric(Text6.Text) Then
MsgBox "You must enter a number!", vbCritical, "Error"
Text6.Text = ""
End If
End Sub
When I enter any name without number, not clicking numbers and click validate it shows the text in the label I typed in the text box but the text is not complete. The last letter you type is missing.
But when you type or enter any name and you click any number. The text you type in the text box will be the same on the label box.
See the image below
![Name: QWE.png
Views: 37
Size: 60.8 KB]()
Thanks in advance
Quote:
Private Sub Command1_Click()
Command3.Enabled = True
Label15 = Val(Text3.Text) * Val(Text4.Text)
Label16 = Val(Text5.Text) + Val(Text6.Text)
Label14 = (Val(Text3.Text) * Val(Text4.Text)) - (Val(Text5.Text) + Val(Text6.Text))
Label10.Visible = True
Label11.Visible = True
Label12.Visible = True
Label13.Visible = True
Label14.Visible = True
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Unload Form1
Form1.Show
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Label11 = Text1.Text
If IsNumeric(Chr(KeyAscii)) Then
MsgBox "Enter Letters only", vbCritical, "Error"
KeyAscii = 0
End If
End Sub
Private Sub Text2_Change()
Label13 = Text2.Text
End Sub
Private Sub Text3_Change()
If Not IsNumeric(Text3.Text) Then
MsgBox "Enter Numbers only!", vbCritical, "Error"
Text3.Text = ""
End If
End Sub
Private Sub Text4_Change()
If Not IsNumeric(Text4.Text) Then
MsgBox "Enter Numbers only!", vbCritical, "Error"
Text4.Text = ""
End If
End Sub
Private Sub Text5_Change()
If Not IsNumeric(Text5.Text) Then
MsgBox "You must enter a number!", vbCritical, "Error"
Text5.Text = ""
End If
End Sub
Private Sub Text6_Change()
Command1.Enabled = True
If Not IsNumeric(Text6.Text) Then
MsgBox "You must enter a number!", vbCritical, "Error"
Text6.Text = ""
End If
End Sub
But when you type or enter any name and you click any number. The text you type in the text box will be the same on the label box.
See the image below
Thanks in advance