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

Criteria for opening Report 1

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi Guys,
I have a report that opens from a button on a form that filters for different criteria (Option Group) and would like a label to appear on the report showing which one is being filtered for.

Here are the criteria:

Filter 1 = All --> Combination of 2 and 3

Filter 2 = Cleared --> only shown records with dates, check has been done.

Filter 3 = Uncleared --> Only shown blank date fields,no check.

I have tried this:

If Not IsNull(Me!OHCleared) Then
Me!LabelOHCleared.Visible = False
Else
Me!LabelOHUncleared.Visible = True
End If

If Not IsNull(Me!DisCleared) Then
Me!LabelDisCleared.Visible = False
Else
Me!LabelOHUncleared.Visible = True
End If

But it's not recognising the blanks in the date field and I'm not sure hot to do the all part.

I also have another option group (Disclosure Check) but i think it will be the same as this.

I hope this is clear enough and any help would be appreciated as always.
 
you can directly reference the option group from your report by doing:

if forms("FormName").OptionGroup = 1 then
me.Label.Caption = "opt1"
elseif forms("FormName").OptionGroup = 2 then
...

or you can use the OpenArgs when you activate the report, this method would be better if you're going to re-use this report from other places...

--------------------
Procrastinate Now!
 
Hi Crowley16,
The first option is what I need:

Private Sub Report_Open(Cancel As Integer)

If Forms("FormAd/HocReports").OptionFrame1 = 1 Then
Me.LabelOHCleared.Caption = "OH Cleared and Uncleared"

ElseIf Forms("FormAd/HocReports").OptionFrame1 = 2 Then
Me.LabelOHCleared.Caption = "OH Cleared"

ElseIf Forms("FormAd/HocReports").OptionFrame1 = 3 Then
Me.LabelOHCleared.Caption = "OH Uncleared"
End If

End Sub

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top