Input Box Help

keith701a

Registered User.
Local time
Today, 02:22
Joined
Aug 9, 2016
Messages
38
I have this code working for Field1 (Last, First names):
Dim strInput As String
strInput = InputBox("Enter Last, First")
DoCmd.OpenReport "FAX", acViewReport, , "Field1 = '" & strInput & "'"


I need a second field "Report_Number_Subjects" filtered as well. This field is in a subreport of "FAX" named"FAX_Subjects." The source of the subreport is a table "Request_Subjects."

If an input box isn't the best way to go should I tie the filters to unbound text boxes? If I do that how do I code for it?
 
Wouldn't the subform/subreport controls linked Fields do this automatically?

Sent from my SM-G925F using Tapatalk
 
Assuming the sub report is only to display a particular child record.

Rather than base your report/subreport on tables, you could make the data source a query that includes a prompt for the criteria

eg for the sub report, the data source would be
Code:
 select * from Request_Subjects where FAX_Subjects=[What is the FAX subject?]
 
Got it, thanks!

For some reason the queries I was writing were not working properly. I have two fields linked to the same field in a table (a table of employees links to the requester and assigned field). Originally the queries would open contact information for the requester, not the assigned person. It's working fine now...
 
I spoke too soon. It is still doing it, it only seemed to not because I was using a test record in which I was both the requester and assigned person.

Is there a way to force access to display the contact information based on "Assigned" instead of "requester"? I don't even have the requester field in this query and it's still basing that information off of it.
 
What if you created a hidden field on the parent and assign value 2 to that.
The subreport could then be filtered on the parent field?
 

Users who are viewing this thread

Back
Top Bottom