Results 1 to 4 of 4
  1. #1
    kattatonic1 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Toronto, Canada
    Posts
    77

    Cool how to default double-click event to zoombox for all fields in a form

    Ugly form. Ugly data. Loving DoCmd.Run Command acCmdZoomBox. Is there a way I can set the default for the double click event for every field on a form to be this? Instead of assigning them one by one?



    Kay
    from Toronto

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    no. You cant.

  3. #3
    kattatonic1 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Toronto, Canada
    Posts
    77
    Thinking aloud...
    What about an On Open event for the form that has a command that sets any double-click to mean open the field in focus in a zoombox? I'm trying things using .OnDblClick. Does that trigger any ideas?

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You can create a Function to do the zooming, select the Controls to be included, then assign the Function to the DoubleClick event of all of the Controls:

    In a Standard Module:

    Code:
    Public Function fExpand(ctl As Control) As Byte
     ctl.SetFocus
     DoCmd.RunCommand acCmdZoomBox
    End Function

    When asked to Save the Module, name it anything except fExpand; having the Function and the Module sharing the same name confuses the Access Gnomes no end!

    Then in Form Design View:

    • Hold down the <Shift> Key and select (Left Click) each Control to be included
    • Go to Properties - Events
    • In the appropriate property (OnDblClick, in this case) enter =fExpand([Screen].[ActiveControl])

    This will place the Function call in the OnDblClick event for all of the selected Controls, in one fell swoop!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Double click on listbox to open up form
    By EthanMoist in forum Forms
    Replies: 14
    Last Post: 05-21-2013, 02:10 PM
  2. Replies: 3
    Last Post: 10-04-2012, 01:33 PM
  3. On Double Click Open Form with two criteria
    By AndreasPanayiotou in forum Programming
    Replies: 3
    Last Post: 09-10-2012, 08:47 AM
  4. Replies: 10
    Last Post: 02-20-2012, 11:25 AM
  5. Opening another form by double click
    By chrisjack001 in forum Access
    Replies: 1
    Last Post: 10-13-2010, 02:19 PM

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