Solved

Append Selected Records to Another Table

Posted on 2013-02-05
4
309 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
ID: 38854600
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
ID: 38854695
I was really looking for compact code that uses SelHeight or similar.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 38855132
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
ID: 38855728
<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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

820 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