I am trying to create a form to pull information from 2 tables.
I have a table called tblCOR and a table tblEXT. The first table holds data for PBXName, City, and COR. The second table holds PBXName, Display and Extension.
I need to create a form os that one someone selects the PBXname from a dropdown list,they get a report of all extensions and Displays for that PBX Name.
I tried some code Ifound elsewhere and tried to tweak it for my needs I and failed miserably. Can someone please help
Originally posted by SteveH
On your form, create a combo box that uses the field PBXName in tblCOR as its record source.
Create a query that has the fields you want on your report, using tblEXT as the record source. Set the Criteria for the PBXName field to equal the value in the combo box on the form.
Create a report that uses the query as a record source.
On the form, create a button that opens the report. The Command Button Wizard will do this quickly.
You shouldn't have to do any VBA coding yourself this way.
This has helped a ton. I have only 1 more question. When I am setting the criteria in the query, What should I be entering? If I leave the criteria field blank, I get all of the Data. I have tried a few things in the criteria field without success.
In the query, put your cursur in the Criteria field under PBXName and RIGHT click. Choose "Build". In the top box of the Expression Builder, type Forms!(form name)!(combo box name). Example: Forms!frmMainForm!cbName.
When you get this working, spend some time reading about and experimenting with the Expression Builder in the online Help.