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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning keys to fields. 1

Status
Not open for further replies.

Rubius

Programmer
May 12, 2000
57
CA
Is it possiable to assign a combo box or a text box a key such as F6 or something..I've been able to get Alt+whatever to work, but the boss wants it easier. Eg. pressing F3 will take me to the date field instead of alt+d<br><br>thanks
 
Fisrt of all when you press a key it depends on what has focus at the time.<br>If a Textbox has focux then you could put the following in the textboxes KeyPress event.<br>Here is one for the form itself.<br>---------------------------------------------<br>Private Sub Form_KeyPress(KeyAscii As Integer)<br>&nbsp;&nbsp;&nbsp;&nbsp;If KeyAscii = &H75 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me!DateField.SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>End Sub<br>---------------------------<br>&H75&nbsp;&nbsp;is the correct value for F6 by the way.<br>But keep in mind you may have to do this all over your form in as many of the possible textboxes or whatever has focus.<br>Which could prove impossible if you have subforms and other controls.<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
hmmmm, ok thanks man...really appreciate the help! Is there a place I can get a list of the codes for all the Function keys?<br><br>thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top