Solved

Append Selected Records to Another Table

Posted on 2013-02-05
4
282 Views
Last Modified: 2013-02-06
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
Comment
Question by:tbsgadi
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
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
 
LVL 46

Author Comment

by:tbsgadi
Comment Utility
I was really looking for compact code that uses SelHeight or similar.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
Comment Utility
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
<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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now