Please help me with enter.. :) I like when i'm enter value on 1 text box,and when i press enter to go on second text box and when i write value i like to press again enter key and txt3.text=val(t xt1.text)*val(t xt2.text)... Please help me what i must write in code for this
help with keypress enter...
Collapse
X
-
Originally posted by JolacePlease help me with enter.. :) I like when i'm enter value on 1 text box,and when i press enter to go on second text box and when i write value i like to press again enter key and txt3.text=val(t xt1.text)*val(t xt2.text)... Please help me what i must write in code for this -
I assume you use VB6 if not adjust this code:
[PHP]Option Explicit
Private Sub Text1_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub[/PHP]Comment
-
Originally posted by iburyakI assume you use VB6 if not adjust this code:
[PHP]Option Explicit
Private Sub Text1_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub[/PHP]Comment
-
Originally posted by iburyakI assume you use VB6 if not adjust this code:
[PHP]Option Explicit
Private Sub Text1_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress( KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub[/PHP]Comment
-
Originally posted by Jolacewell go on next text box but (txt3.text) but not show value for txt2.text * txt1.textComment
-
i dont know how to tell you...in first form.. I have 1 combo box and 3 text boxes and one button. first text box is for const which i choose from combobox and second is for my value... when i press enter go on first to second text box but when i press enter again go on textbox 3 which i like to be protected and when i press enter automatic show value for txt1 * txt2 ... Do you anderstand me... for key enter i'm writing this..
Private Sub Form_KeyPress(K eyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End SubComment
-
Originally posted by Jolacei dont know how to tell you...in first form.. I have 1 combo box and 3 text boxes and one button. first text box is for const which i choose from combobox and second is for my value... when i press enter go on first to second text box but when i press enter again go on textbox 3 which i like to be protected and when i press enter automatic show value for txt1 * txt2 ... Do you anderstand me... for key enter i'm writing this..
Private Sub Form_KeyPress(K eyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub
then use the multiplication code in text3 validate eventComment
Comment