Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number will not display in text box

Status
Not open for further replies.

mobuto

MIS
Aug 26, 2003
13
CA
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
 
try this
Code:
ElseIf KeyAscii = 49 Then
text333.text="1"   
Text335.SetFocus
Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top