Results 1 to 5 of 5

Thread: Use of Function keys to display data

  1. #1

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    50

    Exclamation Use of Function keys to display data

    Dear Sir

    I want to use function keys in my “Inventory Control System” software.

    For example, I want to see the availability of Computer based on ref_no (ref_no does exist in a TextBox which is placed on my MDI form). Then if I press F2 or F3 or F4 …., that particular item i.e. Computer related with ref_no will be displayed on a DataGrid.

    Please help me about the use of function keys to serve my purpose.


    Appreciate, if you would come back at your earliest.


    Regards
    Pervez
    Last edited by pervez; Sep 14th, 2009 at 02:43 PM. Reason: Additional information

  2. #2

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    50

    Exclamation Re: Use of Function keys to display data

    Dear Sir

    I forgot to mention that I'm using VB6.0 and for database Access 2002.

    Regards
    Pervez

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Use of Function keys to display data

    You can test which key is pressed in the textbox's KeyDown event.
    Code:
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
       Case vbKeyF4
           ' do something
           KeyCode = 0
        Case VbKeyF3 Then 
           ' do something else
           KeyCode = 0
    
        ' etc
    End Select
    End Sub
    Last edited by LaVolpe; Sep 14th, 2009 at 03:44 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    Member
    Join Date
    May 2009
    Posts
    50

    Resolved Re: Use of Function keys to display data

    Dear Sir

    I'm really greatful. It's working, thanks.


    Regards
    Pervez

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Use of Function keys to display data

    Pervez, you are welcome.
    If this is resolved, please mark it resolved. Use the "Thread Tools" dropdown menu near the top of your first posting above.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width