G
Guest
I seem to be unable to figure out the syntax to allow me to get at Access
data from other programs (in this case Outlook). In this case, I have
selected the Access 11 library and Microsoft Active X 2.7 library as
references. The table in question is called "client" in a database called
"legal files.mdb" Here is what I have so far:
********************************************
Sub GetAccessData()
Dim AccessApp As Access.Application
Set AccessApp = New Access.Application
AccessApp.OpenCurrentDatabase "c:\access\legal files.mdb"
Dim myConnection As ADODB.Connection
Set myConnection = CurrentProject.Connection
Dim myRecordset As New ADODB.Recordset
myRecordset.ActiveConnection = myConnection
myRecordset.Open "[Client]", , adOpenStatic, adLockOptimistic
Dim TotalRecords As String
Dim Records As Long
Records = myRecordset.RecordCount
TotalRecords = Records
MsgBox ("Total Records in Client: " + Records)
End Sub
**********************************************
What am I missing (not that I really understand this or anything). Any help
would be appreciated.
TIA
data from other programs (in this case Outlook). In this case, I have
selected the Access 11 library and Microsoft Active X 2.7 library as
references. The table in question is called "client" in a database called
"legal files.mdb" Here is what I have so far:
********************************************
Sub GetAccessData()
Dim AccessApp As Access.Application
Set AccessApp = New Access.Application
AccessApp.OpenCurrentDatabase "c:\access\legal files.mdb"
Dim myConnection As ADODB.Connection
Set myConnection = CurrentProject.Connection
Dim myRecordset As New ADODB.Recordset
myRecordset.ActiveConnection = myConnection
myRecordset.Open "[Client]", , adOpenStatic, adLockOptimistic
Dim TotalRecords As String
Dim Records As Long
Records = myRecordset.RecordCount
TotalRecords = Records
MsgBox ("Total Records in Client: " + Records)
End Sub
**********************************************
What am I missing (not that I really understand this or anything). Any help
would be appreciated.
TIA