cancel Carriage return

james_halliwell

Registered User.
Local time
Today, 17:11
Joined
Feb 13, 2009
Messages
211
HI,

Please can someone advise on how i can canel the a carriage return and replace with a tab or stop it moving down my subform and make it move the the next field instad of going to a new line
im using the Keydown but dont know how to cancel it, it just bring an message but it stops it moving to a new record,

any help would be greatly appreciated !!!


Code:
Private Sub Barcode_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyReturn Then
    MsgBox "rtn pressed"
    End If
End Sub
    End If
 
Last edited:
Private Sub Barcode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
MsgBox "rtn pressed"
KeyCode = 0
End If
End Sub
 
Private Sub Barcode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
MsgBox "rtn pressed"
KeyCode = 0
End If
End Sub



just tested and the focus still moves down instead of across :-(
 
i'm sorry, what version do you have? can u check on File->option->client setting, maybe there is some setting you can change there.
 
managed to sort it, for anyone looking throught the threads i managed it by


KeyDown



If KeyCode = vbKeyDown Then
KeyCode = 0
KeyCode = vbKeyTab


Many thanks arnelgp!!!!! just slightly changed it and it worked
 
If KeyCode = vbKeyDown Then
KeyCode = 0
KeyCode = vbKeyTab

you can remove the Keycode=0, and instead retain KeyCode = vbKeyTab on your code.
 

Users who are viewing this thread

Back
Top Bottom