• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

Append Selected Records to Another Table

Hi Experts,
Has anybody got some nice function/code to copy selected rows of a continuous form/subform and append them in the same/another table?

Gary
0
tbsgadi
Asked:
tbsgadi
  • 2
1 Solution
 
peter57rCommented:
How are you selecting?

To be sure of being able to do this you need a BOUND checkbox (so a field in the table) so that users can select by clicking the checkbox.

However there can be issues if you have multiple users doing this at the same time.
You then need to look at using a local table that has ID values and a yes/no field and you include this table as part of the recordsource.

If you are ALWAYS selecting contiguous records then it is possible to use code without a checkbox but this solution will not work if there is any gap in the selection.

So back to the question at the top....
0
 
tbsgadiAuthor Commented:
I was really looking for compact code that uses SelHeight or similar.
0
 
peter57rCommented:
Well the SelHeight method only works for contiguous records.

Here is a sample...

http://stackoverflow.com/questions/1669946/how-do-i-access-the-selected-rows-in-access

Note the constraints.
0
 
Jeffrey CoachmanCommented:
<Append Selected Records to Another Table>
<I was really looking for compact code that uses SelHeight or similar. >

Another approach would be to use a listbox to display the records.

Then you could even select non-contiguous records, ...then easily collect the ID's, then copy the records based on the collected ID's...
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now