Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Append Selected Records to Another Table

Posted on 2013-02-05
4
Medium Priority
?
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

618 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