Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2020
    Posts
    21

    How combine Fn button within SendKeys function's syntax (DBA)


    Previously, I got help to combine functional keys with Fn button when these keys do not work for MS Access. This button is on my computer.

    It helped.
    Now, when i need to zoom any field data on the form, I press on three buttons together : SHIFT , Fn, F2.

    Usually, I need to use this combination from VBA code (SendKeys function) ,to cause zoom data opening popup window when focus falls on some field of a form.

    The syntax was "sendkeys "^{F2}". Now, I don't success to generate syntax including all three parameters.

    Please, help me, to generate appropiate syntax for sendkeys function.

    Thanks a lot for your time and help.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Are you also using a mouse or only keyboard for some reason? SendKeys is unreliable. If you can, open the zoom form with a double click on a form control instead.

    EDIT - or see the chart and examples here
    https://learn.microsoft.com/en-us/of...keys-statement
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    google "acCmdZoomBox" or "access vba zoombox"
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Join Date
    Sep 2020
    Posts
    21
    Thanks for your reply!

    I put SendKey function under event procedure for On Got Focus option of Text Box control.

    By my assumption ,this should happen every time when the user reaches this Text Box control, even if he uses a mouse or a keybord.

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    As Micron has already pointed out sendkeys is unreliable.

    set focus to the control and run

    Code:
    DoCmd.RunCommand acCmdZoomBox
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Join Date
    Sep 2020
    Posts
    21
    Yes! It works!

    Thanks both of You for Your quick and helpful advices !

    I put this command instead of sendkeys and it works !

    Thanks all others for their attention and replys !

    Have a nice day !

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You really want the zoom whenever the control is entered regardless of what's going on? Seems like that would be a nuisance. Well, if you (or whoever's using the db) is happy then who am I to criticize? Glad we could help.
    Last edited by Micron; 07-05-2023 at 08:02 PM.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I'm with Micron on the double-click event. I'd also add a tool tip text of "Double-Click to Zoom"
    It'll drive a user crazy clicking the close button while tabbing through a form.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-21-2022, 01:43 PM
  2. how to combine iff and dateadd function
    By dave1962 in forum Access
    Replies: 6
    Last Post: 10-11-2018, 11:14 AM
  3. Switch function query to combine tables
    By sandlucky in forum Queries
    Replies: 2
    Last Post: 03-29-2011, 09:46 PM
  4. Combine switch function and Wild cards together
    By sandlucky in forum Queries
    Replies: 0
    Last Post: 03-28-2011, 11:51 PM
  5. Combine insert into syntax
    By Cojack in forum Queries
    Replies: 1
    Last Post: 09-22-2010, 07:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums