Results 1 to 2 of 2
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163

    Selecting rows from Datasheet View

    Within a blank form, I have dropped a subform control which is displaying the contents of the Orders table in Datasheet View.



    I'd like the user to select multiple orders (rows) from this Datasheet by clicking a checkbox or something on the left hand side of the subform control. After which, they can press a command button that will execute some code as I please on each of the selected rows... I notice there is no "select row" feature of the Datasheet View, but this seems like it would be a common scenario. I've imagined a solution of creating an unbound checkbox and placing it as the leftmost column, and the user can place a check in the box to "select the row". Then, they can Press the command button which will somehow peruse the contents of each row (via code) in search of a "checkbox.value = true" condition and then take desired action on that row.

    I'm posting this because I think I can figure that out but was wondering if there is a practical standard for this kind of action, another way that I'm not aware of. If anyone has any information on programming for selected rows in Datasheet view that runs contrary to how I've described it, please share. Any thoughts appreciated,

    Matt

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    To select the row try this. Run from Main form.
    With Me.[NameOfYourSubformControlHere]
    .SetFocus
    .Form![NameOfSomeControlOnTheSubformHere].SetFocus
    RunCommand acCmdSelectRecord
    End With

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

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2013, 02:13 PM
  2. Replies: 3
    Last Post: 08-18-2013, 09:14 PM
  3. Sum Specific Rows as Totals in Datasheet View
    By CementCarver in forum Forms
    Replies: 4
    Last Post: 07-31-2013, 07:31 AM
  4. Replies: 6
    Last Post: 11-21-2012, 05:10 PM
  5. Selecting a Record in Datasheet view
    By JFo in forum Access
    Replies: 3
    Last Post: 11-01-2011, 10:10 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