i have already done it but anyway, thank you to for your code at least i will have an alternative code for this. my code is this:

thank you very much
Dim objAccess As Object
Private Sub Command1_Click()
Dim dbName As String
Dim rptName As String
Dim Preview As Long
Const acNormal = 0
Const acPreview = 2
dbName = "c:\objaccess\gasi2.mdb"
rptName = "bidac"
Preview = acPreview 'acNormal
With objAccess
.OpenCurrentDatabase filepath:=dbName
If Preview = acPreview Then
.Visible = True
.DoCmd.OpenReport rptName, Preview
Else
.DoCmd.OpenReport rptName
End If
End With
End Sub
Private Sub Form_Load()
Set objAccess = CreateObject("Access.Application"

End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
objAccess.Quit
On Error GoTo 0
Set objAccess = Nothing
End Sub