Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 29th, 2005, 03:09 AM
nhl nhl is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 nhl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 14 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old April 12th, 2005, 01:42 PM
TantalasWaros TantalasWaros is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 TantalasWaros User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 34 m 30 sec
Reputation Power: 0
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...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Access VBA Module


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT