hi,
i am getting an error message "variable not defined" (Load rptDetails) when running the following code:
Dim objAccessConnection As ADODB.Connection
Dim RSACCESS As ADODB.Recordset
Dim SQL As String
Set objAccessConnection = New ADODB.Connection
objAccessConnection.CursorLocation = adUseClient
objAccessConnection.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\dinsys\invoice.mdb;"
SQL = "Select * From lumlot where [inv]=158"
Set RSACCESS = New ADODB.Recordset
RSACCESS.Open SQL, objAccessConnection, adOpenKeyset, adLockOptimistic
If Not RSACCESS.EOF Then
Load rptDetails
With rptDetails
Set .DataSource = RSACCESS
.Show
End With
Else
MsgBox "no data to display", vbInformation
End If
RSACCESS.Close
Set RSACCESS = Nothing
am i missing soemthing in references (i already have MS access 9.0 Library there) or is't something else?
i didn't touch vb for almost an year now and need to refresh it a bit...
i am getting an error message "variable not defined" (Load rptDetails) when running the following code:
Dim objAccessConnection As ADODB.Connection
Dim RSACCESS As ADODB.Recordset
Dim SQL As String
Set objAccessConnection = New ADODB.Connection
objAccessConnection.CursorLocation = adUseClient
objAccessConnection.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\dinsys\invoice.mdb;"
SQL = "Select * From lumlot where [inv]=158"
Set RSACCESS = New ADODB.Recordset
RSACCESS.Open SQL, objAccessConnection, adOpenKeyset, adLockOptimistic
If Not RSACCESS.EOF Then
Load rptDetails
With rptDetails
Set .DataSource = RSACCESS
.Show
End With
Else
MsgBox "no data to display", vbInformation
End If
RSACCESS.Close
Set RSACCESS = Nothing
am i missing soemthing in references (i already have MS access 9.0 Library there) or is't something else?
i didn't touch vb for almost an year now and need to refresh it a bit...