0
votes

I have a dropdown combo box in a form for a "Project_ID" called: Combo28 (this is the primary key basically). There are also 5 other "Error_Code" combo boxes called: cboErrCod1, cboErrCod2, cboErrCod3, cboErrCod4, cboErrCod5.

I'm looking to create some sort of "On Change" code that will only display the Error Codes pertaining to the Project_ID selected in the Combo box "Combo28" only.

The error codes are stored in a separate table and each code is associate to a particular project_Id.

Can anyone help?

1

1 Answers

1
votes

I'm not sure why you have exactly five error code comboboxes. To do this easily and let access do all the work for you, you could either:

A: Have a parent form containing the dropdown for project_ID. Create a subform (continuous form view). Set the recordsource to your error codes and Link to Master using Project_ID

B: Create a subform with the recordsource "Select ErrorCodes from yourTable WHERE Project_ID = [Forms]![yourForm]![combo28] Where combo28 is your project_ID. In the after update event for your combobox, call .requery and perhaps .refresh on your subform.