Solved Form and subform

nosrepmynona

New member
Local time
Today, 22:58
Joined
Apr 25, 2020
Messages
6
Hi,
Maybe I don´t use correct defintion to describe, but I hope you understand what I mean.
I have made two queries and each query are linked to separate tables. Each table has relations to one other table, but they are not the same. In each query I can specify my question via msg box using "[...]" in the criteria field. Both queries has the same column asked from, for example in table 1 type a specific postcode number end a table is shown with specific data. In query 2 I type the same postcode and other info is shown.

Now, I would lika to make a form with a form field so I only need to type the postcode once there, and table 1 and table 2 is shown as a form and a subform. I hope you can point me in the right direction like, do I need to type VBA-code to make it happend and so on. I´ve managed to do two separat forms, but I can't make it work with a form and a subform.
 
Hi. If you managed to do it with a form, did you use something like this for the criteria in the query?

Forms!FormName.ControlName

If so, are you saying the query doesn't work when you use the same form as a subform? If so, you'll have to change it to this:

Forms!FormName.SubformName.Form!ControlName

Hope that helps...
 
Ok, thank you. I´ve tried to set up an example file to visualise what I mean, please se attached file.
In the original file it´s a little bit more complicated with more tables and relations.
 

Attachments

Thanks both of you, It works now! I had to make som corrections both in the criteria section and set up of the form and subform correctly. Now it works exactly as I wanted!!
 
Thanks both of you, It works now! I had to make som corrections both in the criteria section and set up of the form and subform correctly. Now it works exactly as I wanted!!
Hi. Congratulations! Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom