inputparameters for access project from vb6

D

dk

is there a way to pass parameter from a vb6 form into an access project report which is using a store
procedure

where could it be added in this code

tia
d

Public Sub executeAccessReport(strReportName As String, strFilter As String, bPreview As Boolean
Dim AccessApp As Objec
Dim mode As Byt

'Set AccessApp = GetObject(PATH_ASSISTANT & "\adp1.adp", "Access.Application"
Set AccessApp = GetObject("\\nycw02801\icms_test\adp1.adp", "Access.Application"

If bPreview The
mode =
Els
mode =
End I

On Error GoTo finis
With AccessAp
.CurrentProject.CloseConnectio
.CurrentProject.OpenConnection "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=contracts;Data Source=nycs3922" 'Application.ConnectionStrin
'.CurrentProject
.DoCmd.OpenReport strReportName, mode, , strFilte
If bPreview The
.DoCmd.Maximiz
.Visible = Tru
Els
.DoCmd.Clos
.Qui
MsgBox "Finished
End I
End Wit

Set AccessApp = Nothin
Exit Su

finish
nNumber = Err.Numbe
strDescription = Err.Descriptio
If nNumber <> 2501 And nNumber <> -2147417848 Then '2501 = Report cancelled (occurs when there is no data
On Error Resume Next ' -214... = Automation error (it often occurs when printing,don 't know why
AccessApp.DoCmd.Clos
AccessApp.Qui
MsgBox "Printing error (" & nNumber & ") " & strDescription, vbOKOnly, "Error
End I
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top