Input Box Help (1 Viewer)

keith701a

Registered User.
Local time
Today, 03:34
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?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 11:34
Joined
Jul 9, 2003
Messages
16,426
Wouldn't the subform/subreport controls linked Fields do this automatically?

Sent from my SM-G925F using Tapatalk
 

Cronk

Registered User.
Local time
Today, 20:34
Joined
Jul 4, 2013
Messages
2,777
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?]
 

keith701a

Registered User.
Local time
Today, 03:34
Joined
Aug 9, 2016
Messages
38
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...
 

keith701a

Registered User.
Local time
Today, 03:34
Joined
Aug 9, 2016
Messages
38
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.
 

liddlem

Registered User.
Local time
Today, 11:34
Joined
May 16, 2003
Messages
339
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

Top Bottom