I am able to do this while I step through the code using either KeyPress or KeyDown events on the combo-box. However, if I just run it while looking a the form, it does not run correctly, it just enteres a "1" as the text value instead of as the ID (column 1)....
Here's the code:
I've had both of these work, separately of course, when stepping through, but not when I just let it run.
Thanks for any suggestions/info,
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
Here's the code:
Code:
Private Sub cboAcctFrom_KeyDown(KeyCode As Integer, Shift As Integer)
If cboAcctFrom.Text = vbNullString Or cboAcctFrom.Text = "1" Then
DoEvents
If KeyCode = 49 Then 'number 1
cboAcctFrom = 2
cboAcctFrom.Undo
End If
End If
End Sub
Private Sub cboAcctFrom_KeyPress(KeyAscii As Integer)
If cboAcctFrom.Text = vbNullString Or cboAcctFrom.Text = "1" Then
DoEvents
If KeyAscii = 49 Then 'number 1
cboAcctFrom = 2
End If
End If
End Sub
I've had both of these work, separately of course, when stepping through, but not when I just let it run.
Thanks for any suggestions/info,
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57