Results 1 to 7 of 7
  1. #1
    sra2786 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Location
    Cincinnati, OH
    Posts
    38

    How to select non-contiguous records in a datasheet

    Is the only way to select non-contiguous records in a datasheet is to add a Yes/No field and have this field bound to a checkbox? Is there any "trickery" to add the Yes/No field using SQL code instead of adding it to a table?

    Thanks.
    Sandy

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Correct.

    No trickery.

    Field must be in table.

    However, if this is a multi-user database, users will conflict with each other setting the field value.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sra2786 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Location
    Cincinnati, OH
    Posts
    38
    June7,
    Thanks for the quick reply. Only one user will be changing data (for now). I will add this limitation to the documentation.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    For clarity could you give us an example of what you are trying to do?
    Records in a table do not have any specific order. It's a bit like a bag of marbles --you know they're in the bag but any color could be next/near any other color.
    You get order to records by using a Query with an Order By.
    You can select records from a table with criteria (eg. where FName not ="Tom") which would present those records with FName not = "Tom", but how would you know if they were or were not contiguous?
    An example of your data and what you do or do not want the user to Select.

    Good luck with your project.

  5. #5
    sra2786 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Location
    Cincinnati, OH
    Posts
    38
    My data is in a Datasheet view. The user wants to be able to select multiple records in the datasheet view and then select a command button to move the selected records to a History table. I cannot use selection criteria to select the records that they want moved to the History table.

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I hesitate to suggest this because you have not provided much (if any) info about your dB (names, number of records, etc.)

    Here goes: Depending on the number of records you will be looking at, you could use a multi-select list box to select the records you want to move, then have code behind a button to loop through the selections to
    1) append the record to a History table and
    2) then delete the record from the original table.


    Hopefully you won't have more than a hundred records to look at at one time.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I advise you to research a multiSelect listbox as Steve did. In effect, you can place records in a listbox on a form. With multiselect the user can select 1 or more records from the list box, and can move the selection according to the logic in your program.
    I found this sample database from Pat Hartman that may be of some help re multiselect listbox.

    Her post and database link are below:



    PatHartmanCommented: 2017-05-22
    Here's an example that uses a multi-select listbox to add data. Look at the add attendance records form. Select multiple members fro the listbox and press the Create Attendance Records. There have been a few situations where I have used multi-select listboxes as a source for new records but usually I use a subform with a combo. It really depends on what the application calls for. To display existing records, I would always use a subform.

    CaML2K-SanatizedData170522.zip

    Good luck.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-23-2016, 08:39 PM
  2. Replies: 7
    Last Post: 06-17-2015, 07:12 PM
  3. Replies: 8
    Last Post: 05-22-2015, 02:28 PM
  4. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  5. Replies: 5
    Last Post: 02-06-2012, 03:58 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