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
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
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.
June7,
Thanks for the quick reply. Only one user will be changing data (for now). I will add this limitation to the documentation.
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.
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.
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.
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.