|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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--> |
|
#2
|
|||
|
|||
|
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:
|
|
#3
|
|||
|
|||
|
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:
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Pushing excel data in Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|