• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some MS Access Help

BChico

Platinum Member
I am trying to create a form, with a subform. I would like to be able to search by the company id in the main form, and have the results displayed in the subform. When i try to do this, it thinks i am trying to modify the company id for the record, i want to be able to search by it, but still be able to edit the controls in the subform.

Anyone know how to do this?
 
Originally posted by: BChico
I am trying to create a form, with a subform. I would like to be able to search by the company id in the main form, and have the results displayed in the subform. When i try to do this, it thinks i am trying to modify the company id for the record, i want to be able to search by it, but still be able to edit the controls in the subform.

Anyone know how to do this?
Why do you need the subform really? You could just make the record source of the main form your query, where Company_ID = [Forms]![Main Form]![Control Name], and then put a drop-down list or something in the main form to search by company ID and set it to requery the form upon update.
 
Okay let's say you want to see details of each company, just as an example. So you go to the properties of the main form (little black box in upper-left corner), and build a query for the form's record source. The query can include the fields you want, say like Address, Phone number, Email, etc. Then you add a field that is Company_ID. In the Criteria field for Company_ID, you set it to equal whatever company you have chosen in the control box on the form. Say the control is a drop-down named cboCompanyID, and the form is called Main. Then for Criteria in Company_ID you put [Forms]![Main]![cboCompanyID]. What this does is only queries fields that have a company ID equal to the one in your control box on your form.

Then you create the form and create a combo box and name it cboCompanyID. Make it query all the possible company IDs so you can choose one from the list. Then add text boxes on the form and bind them to fields from the query to display the results.

Let me know if you're confused about anything.
 
Back
Top