FILTERING REPORTS

mercystone

Member
Local time
Today, 11:40
Joined
Sep 20, 2021
Messages
108
How are you doing everyone? I have a question? How do you filter a report from a tables which the user entered the fields manually? For example:
Name. City. Age
John brown. New York. 35
John brown. Oxford. 40
In this case john brown is from usa and another john brown from England. The user entered those names manually from different subforms.
 
What do you want to filter for - one John Brown - which one? Apply criteria to however many fields needed to assure desired record is returned.
 
Please tell us more about the application, the issue and criticality. If different countries is an issue, why not include Country in your design/data entry? How do subforms fit into your design?
May be just me, but I don't understand what your expectations are/were.
 
Hmm, what is the Primary Key? Because that is what you should be filtering on. If you made the field that holds the Name the Primary Key then that's the problem. There needs to a separate one and you can use Autonumber as the Data Type.
 
In a form the filter works perfectly. I am defeated on how to use it on a report.:-

Private Sub Command221_click()
Form.Country.SetFocus
DoCmd.RunCommand acCmdFilterMenu
End Sub


I now need it to apply in a report so that the user can print only certain names e.g People from New York, USA only.
 
Apply filter in the OpenReport command.
 
How?
Private Sub Report_Open(Cancel As Integer)
?
?
End Sub

Please help
 
Do it on the open report command ?
That is how I normally filter a report?
 
Kindly, I am requesting anyone to assist me with a sample database with OpenReport method. Thanks. Merry Christmas and Happy New year everybody.
 
The OpenReport method is quite simple. There are enough examples and discussion out there on this topic to provide adequate explanation of its use. Gizmo provided you two tutorials. Also explore this tutorial http://allenbrowne.com/ser-62.html
If still need help, post your db for analysis.
 
How are you doing everyone? I have a question? How do you filter a report from a tables which the user entered the fields manually? For example:
Name. City. Age
John brown. New York. 35
John brown. Oxford. 40
In this case john brown is from usa and another john brown from England. The user entered those names manually from different subforms.
you can filter by any combination of fields
- substitution - only by the full value, sometimes it's inconvenient when you don't know the name / surname exactly
- text field - you can search by part of the value, for example *carolina*
- numeric field - can be searched by interval, two search fields
- date field - you can search by interval, two search fields, or only year or year + quarter, the largest variety of options
 

Users who are viewing this thread

Back
Top Bottom