[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB 6 ASCII Code F1

Posted on 2007-07-20
9
Medium Priority
?
1,785 Views
Last Modified: 2008-01-09
Sir, In text box I want if user press F1 key the listbox form POP up. And what is  ASCII  code of F1
0
Comment
Question by:Mehram
  • 4
  • 4
9 Comments
 
LVL 48

Accepted Solution

by:
jpaulino earned 2000 total points
ID: 19529258
The keycode for F1 = 112
0
 

Author Comment

by:Mehram
ID: 19529282
I am using following code in textbox=txtbillofladingno but it is not working

Private Sub TxtBillOfLadingNo_KeyPress(KeyAscii As Integer)
If KeyAscii = 112 Then
Form1.Show
End If
End Sub
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 19529289
You have to set the form KeyPreview = True
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 48

Expert Comment

by:jpaulino
ID: 19529295
... and change to KeyDown event where you use the Keycode
0
 

Author Comment

by:Mehram
ID: 19529307
I have past code into the KeyDown event however could you guide my how could set kepreview = true?
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 19529321
I thought 112 is the VB code and that decimal 112 equates to the 'p' character?  If wrong I apologise but if you are using Visual studio i.e. not vba then I suspect you need to use the keycode parameter from key up or key down event and check that for equivalence to vbkeyf1.

Chris
0
 

Author Comment

by:Mehram
ID: 19529338
no 112 is equivalent to f1 on key code and it is working after changing word keyascii to keycode however i just want to know to to set keypreview true
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 19529352
Select the form on the design mode and on the properties windows select keypreview = true.

But thats only for capture the form events. In the textbox you don't need it.
0
 

Author Comment

by:Mehram
ID: 19529434
Thanks Sir
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month19 days, 18 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question