I have a form with many text boxes, the users either tab or by pressing enter key to move through each of the text boxes, once they enter the value in them. When they come to the last textbox(txtq28) to which they have to enter the value, I want
Once they enter the value in txtq28, and if they hit tab I want call the click event of the command button(cmdsave) which uses all the value and calculates the outlier and also saves the data.
Or if they hit enter after entering the value in txtq28, the same thing should happen. I tried doing this in couple of ways - by setting the default property of commnad button to Yes(this works but it won't allow them to exit other text boxes by hitting enter.
Or I tried putting this code in the keypress event of the q28, but it is not working what am I doing wrong.
Private Sub txtQ28_KeyPress(KeyAscii As Integer)
If (KeyAscii = vbKeyReturn) Then
'ENTER key is pressed
Call cmdSave_Click
end If
End Sub
there are couple of other text boxes after the q28 that are locked and display the results of the outlier.
In summary I need three ways to fire cmdsave_click -
1. by clicking on the cmdsave button.
2. by pressing enter in q28 text box.
3. and third by pressing tab on to q28. (This also is not working it gives some odbc -call failed error).
hope someone can help me.
thanks
Once they enter the value in txtq28, and if they hit tab I want call the click event of the command button(cmdsave) which uses all the value and calculates the outlier and also saves the data.
Or if they hit enter after entering the value in txtq28, the same thing should happen. I tried doing this in couple of ways - by setting the default property of commnad button to Yes(this works but it won't allow them to exit other text boxes by hitting enter.
Or I tried putting this code in the keypress event of the q28, but it is not working what am I doing wrong.
Private Sub txtQ28_KeyPress(KeyAscii As Integer)
If (KeyAscii = vbKeyReturn) Then
'ENTER key is pressed
Call cmdSave_Click
end If
End Sub
there are couple of other text boxes after the q28 that are locked and display the results of the outlier.
In summary I need three ways to fire cmdsave_click -
1. by clicking on the cmdsave button.
2. by pressing enter in q28 text box.
3. and third by pressing tab on to q28. (This also is not working it gives some odbc -call failed error).
hope someone can help me.
thanks