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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Serverfilter property when opening Report?? not Filter

Status
Not open for further replies.

hblabonte

Programmer
Oct 3, 2001
84
US
Hello all,

I need to pass a Serverfilter paramater when opening a report. Can anyone tell me how to do this? I am not looking to apply a "filter"... I need to use the "serverfilter" property. This is an Access project with SQL Server backend.

When I open my report in design mode and set the server filter with "Building = 'DN'", things work great, so how do I pass that?

From a form, I am opening this report. The user wants to select one building. I know how to set the serverfilter property on a form, but how do you do this with a report?

With the form, I'd use this....
Forms!frmMainMenu.ServerFilter = "Building = 'DN'"
but not sure how to use the DoCmd.OpenReport and pass that setting.

Thanks in advance!

 
I found a workaround to my problem. I thought I'd post it in case anyone else has a similar problem.

In my report, I have an onopen event where I check if my calling form is open. If it is, I capture the selected value (from a combo box). Then I set the serverfilter property.

AMnum = Trim(Forms!frmverificationreport.cmbAM)


If Me.ServerFilter = "" Then
Me.ServerFilter = "NPosNum = " & Chr(39) & AMnum & Chr(39)
End If

It's good workaround since I don't know if there is a way to pass a property value on an openreport command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top