I have written this cdoe for my database,
Private Sub Text333_KeyPress(KeyAscii As Integer)
If KeyAscii = 48 Then
DoCmd.Close acForm, "Medication Problems", acSaveYes
DoCmd.OpenForm "Medication Problems (Short Form)"
ElseIf KeyAscii = 49 Then
Text335.SetFocus
ElseIf KeyAscii = 50 Then
Text335.SetFocus
ElseIf KeyAscii = 51 Then
Text335.SetFocus
End If
End Sub
When I try to execute the code in my form, the numbers don't show up in the text box. For instance, when I press "1" on the keyboard, the cursor just go's to the next control, Text335, and the number "1" doesn't show up in Text333, can someone help me figure out how to get the number to show up in Text333. Thanks
Private Sub Text333_KeyPress(KeyAscii As Integer)
If KeyAscii = 48 Then
DoCmd.Close acForm, "Medication Problems", acSaveYes
DoCmd.OpenForm "Medication Problems (Short Form)"
ElseIf KeyAscii = 49 Then
Text335.SetFocus
ElseIf KeyAscii = 50 Then
Text335.SetFocus
ElseIf KeyAscii = 51 Then
Text335.SetFocus
End If
End Sub
When I try to execute the code in my form, the numbers don't show up in the text box. For instance, when I press "1" on the keyboard, the cursor just go's to the next control, Text335, and the number "1" doesn't show up in Text333, can someone help me figure out how to get the number to show up in Text333. Thanks