[RESOLVED] report - no report
Hi,
I am trying to view an access report in visual basic, i know it can be done but Im having trouble. Please could you have a look at my code and see if anything looks wrong as i get the following error...... "run time error '7866' access can't open the database because it is missing, or open exclusively by another user."
VB Code:
Dim AcApp As Access.Application
Set AcApp = New Access.Application
Dim strPath As String
strPath = App.Path
strPath = strPath & "C:\Documents and Settings\Tim\Desktop\Program\Database\database.mdb"
AcApp.OpenCurrentDatabase strPath
AcApp.Visible = True
AcApp.DoCmd.OpenReport "payments", acViewPreview
AcApp.DoCmd.Maximize
AcApp.Quit
Set AcApp = Nothing
When i got the error message I checked the directory names and they are fine. So i then tried to close the database connection with this code before the report coding began...
and I got this message "object variable or block variable not set"
If you can help me I will be very grateful.
I am using vb6 and a access 97 database. I have selected the microsoft access 10.0 object library.