SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 11th, 2004, 02:27 PM
PADESSO PADESSO is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Florida
Posts: 4 PADESSO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Pushing excel data in Access

Hello all,

I've been stuck for a while on this problem and I don't know if there is a solution... maybe someone can help. I created a frontend on an excel worksheet used for data entry. The add record button puts what the user has entered into a new row on the next worksheet. I'm looking for a way (vb macro) to push this data into an Access table rather than an excel worksheet. I tried the following, but it results in an error. Any help would be appreciated.

Dim currentDB As Database
Dim Data As Recordset

Public Sub Form_Load()

Set currentDB = OpenDatabase("Template.mdb")
Set currentRS = currentDB.OpenRecordset("Data", dbOpenDynaset)

End Sub

I get an error on when I set the database.

ActiveX component can't create an object...

thanks,
--patrick-->

Reply With Quote
  #2  
Old October 11th, 2004, 07:31 PM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 4
Smile RE: Pushing excel data in Access

Hello Padesso,

You can't use CurrentDB as a variable since the CurrentDb function returns an object variable of type Database. I think you expect something like this. Hope it will help.

'----------------------------
Public Sub Form_Load()
Dim MyDb As Database
Dim MySet As Recordset

Set MyDb = CurrentDB.OpenDatabase("Template.mdb")
Set MySet = CurrentDB.OpenRecordset("Data", dbOpenDynaset)

End Sub
'----------------------------





Quote:
Originally Posted by PADESSO
Hello all,

I've been stuck for a while on this problem and I don't know if there is a solution... maybe someone can help. I created a frontend on an excel worksheet used for data entry. The add record button puts what the user has entered into a new row on the next worksheet. I'm looking for a way (vb macro) to push this data into an Access table rather than an excel worksheet. I tried the following, but it results in an error. Any help would be appreciated.

Dim currentDB As Database
Dim Data As Recordset

Public Sub Form_Load()

Set currentDB = OpenDatabase("Template.mdb")
Set currentRS = currentDB.OpenRecordset("Data", dbOpenDynaset)

End Sub

I get an error on when I set the database.

ActiveX component can't create an object...

thanks,
--patrick-->

Reply With Quote
  #3  
Old October 12th, 2004, 09:49 AM
PADESSO PADESSO is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Florida
Posts: 4 PADESSO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks JamesLE,

Once I installed the proper DAO references, that very question came up and I changed the names and poof... An access entry from excel. magic.

Patrick


Quote:
Originally Posted by JamesLe
Hello Padesso,

You can't use CurrentDB as a variable since the CurrentDb function returns an object variable of type Database. I think you expect something like this. Hope it will help.

'----------------------------
Public Sub Form_Load()
Dim MyDb As Database
Dim MySet As Recordset

Set MyDb = CurrentDB.OpenDatabase("Template.mdb")
Set MySet = CurrentDB.OpenRecordset("Data", dbOpenDynaset)

End Sub
'----------------------------

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Pushing excel data in Access


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 1 hosted by Hostway