Open Report using current records show in query filtered from form text box.. (1 Viewer)

Jake1234

New member
Local time
Today, 03:25
Joined
Oct 24, 2019
Messages
7
I'm having trouble figuring out how to do this.


So i have a form containing an input box where you type a name, then clicking the submit button opens the query using the name in the input box as the filter to show only records of that name which all works fine.


Next i want to also have a report open (which i've already designed etc.) that shows whichever records are currently filtered from the form in the query. the report contains the same fields as the query just presents it better and then can be printed etc.


the report's field's conrol sources are the query fields, i've tried switching them to the main table fields but that doesnt work either. when i run the report now with the filtered query open, it displays errors in all of the fields however multiplies the report to the correct number of records showing in the query so it seems that it is recognising the records are there just not putting all the information in the right place.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:25
Joined
Oct 29, 2018
Messages
21,453
Hi Jake. Welcome to AWF! If you base the report to the query, wouldn't it only display what the query is displaying? If not, we'll need to see your code for opening and filtering the query. You might be able to use the same technique against your report.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:25
Joined
May 7, 2009
Messages
19,231
what does the error shows.
 

Jake1234

New member
Local time
Today, 03:25
Joined
Oct 24, 2019
Messages
7
Hi Jake. Welcome to AWF! If you base the report to the query, wouldn't it only display what the query is displaying? If not, we'll need to see your code for opening and filtering the query. You might be able to use the same technique against your report.


Yes my report is based on the query im quite sure, the criteria i use for one of the query fields is:

Like "*" & [Forms]![Search CAD]![Text0] & "*"


so it filters the query based on what i write in the forms input box, then opens both the query and the report but yeah the report jsut shows all errors in all the fields


OpenQuery
CAD
Datesheet
Read Only
OpenReport
View CADs
Report
-
-

Normal


this is also the button that is on the form after you input the name. ive tried a few things in the Where Condition but not been successful.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:25
Joined
Oct 29, 2018
Messages
21,453
Yes my report is based on the query im quite sure, the criteria i use for one of the query fields is:

Like "*" & [Forms]![Search CAD]![Text0] & "*"


so it filters the query based on what i write in the forms input box, then opens both the query and the report but yeah the report jsut shows all errors in all the fields
Okay, that doesn't make sense. If the report is based on the query, then it should show what the query is showing. You may have to show it to us. Are you able to post a demo version of your db? We just need the table, query, form, and report related to this issue.
 

Jake1234

New member
Local time
Today, 03:25
Joined
Oct 24, 2019
Messages
7
Okay, that doesn't make sense. If the report is based on the query, then it should show what the query is showing. You may have to show it to us. Are you able to post a demo version of your db? We just need the table, query, form, and report related to this issue.


I can't really share any of that just because of the information on the db sorry, but i am right in setting the report's record source to the query, then on the report having all the field's control sources be the fields in the query?
 

Users who are viewing this thread

Top Bottom