Re: Use a form to query a report
- From: "Al Camp" <anon@xxxxxxxx>
- Date: Wed, 1 Jun 2005 17:17:01 -0400
From your response, I suspect you might not have a lot of experience with
Access. So... I'd like you to reconsider my previous solution... as being a
bit easier to understand and implement.
If you don't feel your users will be able to handle "Filtering by form"
or "Filtering by selection" then Bruce's suggestion would be the best
choice.
1. My method allows the user to use the "Filter by Form" or "Filter by
Selection" function to decide what records will be delivered to the report.
If you filter for City, the report will be filtered for City. If you filter
by City AND State... the report will filtered for City AND State.
2. No need to build a seperate form to define Parameters for the report
query.
3. Instead of just 6 parameters, you can filter your form by as many
factors as necessary.
4. If your form is NOT filtered, the report returns just the "active
displayed" record.
4. It's quick and simple to understand and implement.
Use the normal form that you use to view your records (RecordSource = All
Records)
Create your form and use the same RecordSource as your form (RecordSource =
All Records)
Place this code in the Open event of your report... (using your form
name)
Private Sub Report_Open(Cancel As Integer)
If Forms!YourFormName.FilterOn = False Then
Me.Filter = "CustID = Forms!frmYourFormName!CustID"
Me.FilterOn = True
Else
Me.Filter = Forms!frmYourFormName.Filter
Me.FilterOn = True
End If
End Sub
hth
Al Camp
"Randy" <ranmcc@xxxxxxx> wrote in message
news:1117656696.207136.140500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am not real clear on the section below.
>
> In the parameter query (design view) set the parameter to:
> LIKE Forms!frmFind!txtDOB
> OR Forms!frmFind!txtDOB Is Null
> for each field (using the appropriate control name from frmFind). This
> will
> work for maybe 5 or 6 criteria. If you need to do more than that you
> may
> need another approach, but since you have not been specific I will
> leave it "
>
> I do have six fields I would like to put on the form. When I create
> the unbound form and then the unbound text fields I can click open the
> properties and then click on the event procedure and it will bring me
> up to a query, but all the fields in the column are blank. What do I
> need to do from here to complete the parameter query according to your
> instructions. This is where I am getting stuck.
>
.
- References:
- RE: Use a form to query a report
- From: BruceM
- Re: Use a form to query a report
- From: Randy
- RE: Use a form to query a report
- Prev by Date: Re: Use a form to query a report
- Next by Date: Re: Form Design
- Previous by thread: Re: Use a form to query a report
- Next by thread: Re: Use a form to query a report
- Index(es):
Relevant Pages
|