send data from a table to another

cvboas

Registered User.
Local time
Today, 14:27
Joined
Jul 31, 2006
Messages
20
Hi, again...
I have a problem. I want to create a button to send the data of a table to another table. I have a table "budget" and i want so send to another one "order".
Thank You.

;)
 
hi cvboad,

ok, u need to create a form and insert the similar code behind that button.
------------------------------
dim db as database
dim str as String
dim rst1 as Recordset
dim rst2 as Recordset

str = " select field1, field2, field3 from Budget"
set rst1 = db.openRecordSet(str)
str = " select field1, field2, field3 from Order"
set rst2 = db.openRecordSet(str)
rst1.moveFirst
Do until rst1.EOF
rst2.addnew
rst2.field(1) = rst1.field(1)
rst2.field(2) = rst1.field(2)
rst2.field(3) = rst1.field(3)
rst2.update
rst1.movenext
loop
rst1.close
rst2.close
set rst1 = Nothing
set rst2 = Nothing
--------------------------------------------


Regards,
Umer
 
But why?

A properly designed database wouldn't need to "send" budget data to order; they'd be related instead which can be pulled together with a query.
 

Users who are viewing this thread

Back
Top Bottom