Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameterized report called from vb???

Status
Not open for further replies.

pms18066

Programmer
Jan 12, 2005
94
US
I want to call a report which calls for one parameter. When the visual basic app makes the call it does not prompt for the parameter. My question how do I pass the parameter to the report sionce it doesn't prompt me to enter one???

 
Can you remove the parameter from the report's record source and use the where clause in DoCmd.OpenReport?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
i am not very familiar with the openreport call as to how to add the where clause ill try and look into that though
 
How does your "visual basic app make the call"?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I looked at the wherecondition parameter and am trying to get it to work now.

Here is the func making the call to the report

Private Sub DoReport(rptName as string)

Dim objaccess As Object

On Error GoTo PrintAccessReport_ErrHandler
Set objaccess = CreateObject("Access.Application")

With objaccess
.OpenCurrentDatabase filepath:="C:\program
files\SIFManager\welchsif.mdb"
.DoCmd.OpenReport reportname:=rptname, View:=2
.Visible = True
.DoCmd.Maximize 'maximizes the Report window
.DoCmd.Maximize 'maximizes Access window
End With

Set objaccess = Nothing
 
You would add the where parameter to .DoCmd.OpenReport...

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top