Report won't print (1 Viewer)

Erin M 2021

Member
Local time
Today, 14:44
Joined
Apr 14, 2021
Messages
77
Hi there, I've created a report that runs from a form based on the selections within the form (different names). This report is essentially a 'hub' for 4 sub reports. The report runs fine Report View, but when I go to print preview or just try to export, I get an error and it eventually takes me to a blank report.

Error:

Run-time error '2101': The setting you entered isn't valid for this property.

When I go to debug, it references the form.

Private Sub Report_Open(Cancel As Integer)

Me.Filter = [Forms]![Prospect Reports Manager]![Solicitors]

End Sub

What I'm not able to figure out is that these sub reports each are based off the Solicitors within the form and print separately just fine.
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:44
Joined
Jan 23, 2006
Messages
15,364
Your filter seems suspect.

Typical filter structure

Code:
Me.Filter = "[Name] Like " & Chr(34) & Me.Text32 & "*" & Chr(34)
   Me.FilterOn = True

or

Code:
Me.Filter = "DptCd =" & Chr(34) & Me.Text37 & Chr(34)
 

Erin M 2021

Member
Local time
Today, 14:44
Joined
Apr 14, 2021
Messages
77
Your filter seems suspect.

Typical filter structure

Code:
Me.Filter = "[Name] Like " & Chr(34) & Me.Text32 & "*" & Chr(34)
   Me.FilterOn = True

or

Code:
Me.Filter = "DptCd =" & Chr(34) & Me.Text37 & Chr(34)
Solicitors is based on a table.
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:44
Joined
Jan 23, 2006
Messages
15,364
??? So what exactly do you want in the report?
??? The filter acts as a constraint so you need to constraint all of the solicitors to some specific one or group
A specific solicitor or group of solicitors?

Me.Filter = "Solicitor =" & Chr(34) & [Forms]![Prospect Reports Manager]![Solicitors] & Chr(34)
 

Erin M 2021

Member
Local time
Today, 14:44
Joined
Apr 14, 2021
Messages
77
??? So what exactly do you want in the report?
??? The filter acts as a constraint so you need to constraint all of the solicitors to some specific one or group
A specific solicitor or group of solicitors?

Me.Filter = "Solicitor =" & Chr(34) & [Forms]![Prospect Reports Manager]![Solicitors] & Chr(34)
No sure I'm fully understanding, but I attempted this with no luck. Why would the full report open in report view but not in print preview when it's using the same filter?
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:44
Joined
Jan 23, 2006
Messages
15,364
Don't know.
Check similar threads and google
 

bastanu

AWF VIP
Local time
Today, 12:44
Joined
Apr 13, 2010
Messages
1,401
Why filter the report(s) and not restrict the record source(s) based on the [Forms]![Prospect Reports Manager]![Solicitors] value?
When you set the filter you also have to set the FilterOn property as jdraw showed in post #2.
Cheers,
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:44
Joined
May 7, 2009
Messages
19,169
make your report Generic.
do not filter using Open event of the report.
instead do the filtering 'when you open" it using DoCmd:

Docmd.OpenReport ReportName:="theReportName", WhereCondition :="[Solicitors] = '" & Me![Solicitors] & "'"
 

Users who are viewing this thread

Top Bottom