from query to form 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?
 
V

Van T. Dinh

I am questioning whether it is the correct thing to do?

It sounds like you store the same data twice and storing duplicated merely
add inefficiencies and inconsistencies problem in your database.

The Relational Database Design Theory also advises that Calculated Values
should be re-calculated whenever needed and should not be stored in Tables
since storing Calculated Values will create inconsistencies sooner or later.
 
S

Sean Jackson

When you click the button, use the recordsetclone method, which will create
a NEW recordset which is a copy of the forms recordset.

dim rs as recordset
set rs = me.recordsetclone (or whatever)

scroll thru the new recordset, using

do until rs.eof

'''do the INSERTS here
rs.movenext
loop
 
B

bob

Does this sound right then?

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.
 
B

bob

Hello Van:

Does this sound Ok then?

I do not know if I have any otehr alternatives.

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.

-----Original Message-----
I am questioning whether it is the correct thing to do?

It sounds like you store the same data twice and storing duplicated merely
add inefficiencies and inconsistencies problem in your database.

The Relational Database Design Theory also advises that Calculated Values
should be re-calculated whenever needed and should not be stored in Tables
since storing Calculated Values will create
inconsistencies sooner or later.
 

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