By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Display Query Results in Subform.

P: 1
Hello everyone.

I currently have a database with 2 main forms. One is the main screen, second is the search form. I have built the query with this Criteria: Like "*" & [Forms]![ClientSearchF]![FirstName] & "*"

When searching, this brings up results fine. I need these results to appear in a subform located on the same form when clicking the button I've set to run the query. I'm just needing to know how I would display the results without any VBA coding.

Any help would be fantastic, I'm kind of new to this.
Jun 2 '17 #1

✓ answered by NeoPa

JForbes is absolutely right. As an inexperienced developer you may well think of it as running the query when you click the button, but the query is already run when the main form is opened. All you really need at this point is for the subform form (A SubForm is actually just the control that another form is contained in.) to be requeried. At which point it will be done with the existing parameters, which in your case means reflecting the currently selected name to filter on.

Share this Question
Share on Google+
2 Replies


jforbes
Expert 100+
P: 1,107
Unless there is something I'm missing, create a SubForm and base it on the same Query you have your MainForm based on and it should work. You may need to Requery your SubForm when you change the Criteria.
Jun 2 '17 #2

NeoPa
Expert Mod 15k+
P: 31,186
JForbes is absolutely right. As an inexperienced developer you may well think of it as running the query when you click the button, but the query is already run when the main form is opened. All you really need at this point is for the subform form (A SubForm is actually just the control that another form is contained in.) to be requeried. At which point it will be done with the existing parameters, which in your case means reflecting the currently selected name to filter on.
Jun 2 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.