query data to table

B

bob

I have a table from where I am getting some data by a
query,in the query I am adding two fields for some
calculation fields. This data from the query is then
displayed on a form where two more fields are added.

Now on the click of a button on this form I want to put
all the data on the form in to a seperate table (not the
original table).

How would I do that?
 
J

Jim

To make sure I understand . . .
-query is tbl + calcfield1 + calcfield2
-form has query + field3 + field4
-You want to want to append the data shown on the form
(only the current record shown) to another table?

First, it is not good database design to store calculated
fields in a table, using a query (or a form) these fields
can always be "calculated". Second, if the two "new"
fields on the form are needed, why not store in the table;
or are they also calculated in which case you have my
first argument plus the additional why can't the query
calculate 3 and 4 also.

To answer your question (apologies not detailed, but do
not have Access open right now; Access help has examples
on adding records to tables using recordsets):
In the buttons on-click event:
1)open a recordset from the table you want to copy
2)addnew to the recordset
3)for each field to append use the forms data (either from
the forms recordset or using the forms controls.value)
4)update the record
5)close the recordset

Hope this helps.
 
B

bob

this is what my plan is........

write a select query to get the data from that table which
already exists with the students records and do that T
hours calc in the query.

Put all this data on a form. Now using the exempt,login
time,program code etc for the user to slect all that.

then this form1 is ready to be submitted.

But do not submitt it straightaway instead create a
recordset clone.....form2.

dim rs as recordset
set rs=me.recordsetclone
do until rs.eof
insert.....
rs.movenext
loop

now table_temp is ready with all the data

then use another button on that form which will append
this data to the tblattendance.
then some another button will go and delete all the
records in this temp_table. So it now has zero records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top