Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can I export a certain record into a seperate table

Posted on 2011-03-01
13
Medium Priority
?
287 Views
Last Modified: 2012-06-22
Hello Experts,

I have a A 2003 .mdb and was curious if I could export or save a forms data to another table/form.

Let's say I had a form full of values that I no I would need to use at later time. Is it possible to save a forms data into a different table so only the Important data would be in the table called Important.

Every record can be viewed in the existing form called Costs, but I would like to save certain records to another form/table called Important.

Thanks,
patentinv
0
Comment
Question by:patentinv
[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
  • 6
  • 5
  • 2
13 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1400 total points
ID: 35011098
yes you can, by using vba codes.

dim rs as dao.recordset
set rs=currentdb.openrecordset("Important")
rs.addnew
   !field1=me.text1
   !field2=me.text2


rs.update
0
 

Author Comment

by:patentinv
ID: 35011244
Hello Capricorn1,

So can this code be ran on a command buttons on click procedure, and will it be able to save the record that the form is currently in, to a different table?

Thanks,
patentinv
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35011380
yes, use the click event of a command button
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 85
ID: 35011383
Or you could add another field to the table where you could set a record to be "Important" - a yes/no field, for example. Storing data in two different places is generally not a good idea.
0
 

Author Comment

by:patentinv
ID: 35011654
How would I recall only the records marked "yes/important" when I needed them?

Thanks
patnetinv
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35011694
you can create a query lke this

select * from table
where important=true
0
 

Author Comment

by:patentinv
ID: 35012011
select * from table <- This will need a table to be saved to correct?  If this is the case I might as well use  the command button approach and save it now to a table then there will be no need to run a query later to save it.

Hope I'm seeing this correctly.

Thanks,
patentinv
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35012061
if you are asking about the comment posted by LSM,

select * from table << the "table" is the name of your current table, not the "Important" table.
0
 

Author Comment

by:patentinv
ID: 35012226
My point is the data will eventually end up being stored in two different places, sooner or later.

So I may as well store it now in a different location by using the command button approach, and then I create form bound to it, so I can view it now.

Thanks
patentinv
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35012277
ok, then. use the codes i posted at http:#a35011098

0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 600 total points
ID: 35012603
<My point is the data will eventually end up being stored in two different places, sooner or later.>

In most cases, that's not true. Data is generally only stored in ONE place, and is used from there. There are some legitimate reasons to break data out from tables, but in most cases those involve archiving data that will never again be in "live" use.

My point is that if you include a field in your CURRENT table where you can "flag" a record as important, you can then use a query to filter those records. capricorn has shown you how to do this by building a simple query.

All in all, you should strive to ONLY store data in a single location. There is no reason to store data in multiple locations, and in fact doing so can cause you to have troubles down the road (since you're never really sure if the data you're looking at is the "right" data or not).

0
 

Author Comment

by:patentinv
ID: 35012641
I understand my options I'll think it over and decide which will work the best for me.

Thanks for all the help!!
patentinv
0
 

Author Closing Comment

by:patentinv
ID: 35012653
Now I can make a plan on how to make this work in my case!!

Thanks,
patentinv
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

705 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