i wanna insert data by 1 command button

meenctg

Learn24bd
Local time
Today, 18:14
Joined
May 8, 2012
Messages
133
i have 2 table in my database. I wanna insert data into two tables by one command button. command button name is insertData
My tables are tbl1 (fields: Name,Pay),tbl2 (CostField,Amount)

i wanna insert data
for 1st table
Name=XXXX
Pay=0000

2nd table
CostField=XXXX
Amount=0000

actually i wanna when user click on command button the value XXXX,0000 for tbl1 and the value XXXX,0000 for tbl2 will insert into two tables.

Please any body help me how will i do this.
 
Hi,
Fisrt: why would you have 2 tables for the same data?
OK, say that is realy what you need, I would advise you to look into 2 issuse:
1.
Code:
CurrenDB.execute [SQL_Command]
for running an INSET INTO command
2.
Code:
Workspaces(0).BeginTrans
... 
Workspaces(0).CommitTrans
for having a few command run as one.

If these are new tou you, google them and play around with them abit. be soure to post here more questions if you need.

Good luck!
 
Hi,
Fisrt: why would you have 2 tables for the same data?
OK, say that is realy what you need, I would advise you to look into 2 issuse:
1.
Code:
CurrenDB.execute [SQL_Command]
for running an INSET INTO command
2.
Code:
Workspaces(0).BeginTrans
... 
Workspaces(0).CommitTrans
for having a few command run as one.

If these are new tou you, google them and play around with them abit. be soure to post here more questions if you need.

Good luck!

May be here is not full code. Would you help me for full code. actually i am not expert in VB and SQL. please give me fully code for insert those value in my tables.
 

Users who are viewing this thread

Back
Top Bottom