|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Access VBA Module
Hello quys, i have a probleme and i hope that you help me.. i'm complete a newbe
i have the following: ----------------------------------------------- Public Sub Test1() Dim db as Database Dim rst as Recordset Set db = Currentdb Set rst = db.OpenRecordset("Select * from tbl1;") end sub --------------------------------- Public Sub Test2() Dim db as Database Dim rst as Recordset Call Test1() Set db = Currentdb Set rst = db.OpenRecordset("insert into tbl2 Firstname, Lastname;") end Sub The first procedure selects all from the table tbl1, and the second procedure inserts into tbl2 the fields from procedure 1. How can i make it work.. Please help me guyss i need this 2 know. Many thnx |
|
#2
|
|||
|
|||
|
If i got you right what you really wanna do is selecting everything from tbl1 and inserting it into tbl2.
in that case you shouldn't use recordset, it's too slow and not relly needed. trying assembling an sql sentence which will preform that query and run it, as so: DIM sSQL as String sSQL = "INSERT INTO tbl2 SELECT * FROM tbl1" Docmd.RunSQL sSQL And that's it really, hope i helped... |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Access VBA Module |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|