A family of Microsoft relational database management systems designed for ease of use.
To achieve the desired functionality of filtering the submissions based on the selected application number in your data entry form, you can use a combination of VBA code and the properties of the combo box controls in Microsoft Access.
Here’s a step-by-step approach:
- Set Up Your Combo Boxes: Ensure you have two combo boxes on your form: one for selecting the application number and another for selecting the submission number.
- Let's call the application combo box
cboApplicationand the submission combo boxcboSubmission.
- Let's call the application combo box
- Populate the Application Combo Box: Make sure the
cboApplicationis populated with the application numbers from your Applications table. - Filter the Submission Combo Box: You need to add an event to the
cboApplicationcombo box that triggers when the application number is selected. This can be done using theAfterUpdateevent. Here’s an example of the VBA code you could use:Private Sub cboApplication_AfterUpdate() Dim strFilter As String strFilter = "ApplicationID = " & Me.cboApplication.Value Me.cboSubmission.RowSource = "SELECT SubmissionID, SubmissionOrder FROM Submissions WHERE " & strFilter Me.cboSubmission.Requery End Sub- In this code, replace
ApplicationIDwith the actual field name that links the submissions to applications in your Submissions table. - The
RowSourceproperty of thecboSubmissioncombo box is set to a SQL query that filters submissions based on the selected application number.
- In this code, replace
- Requery the Submission Combo Box: The
Requerymethod refreshes the submission combo box to reflect the filtered results based on the selected application. - Test the Form: After implementing the above code, test your form by selecting an application number and checking if the submission combo box updates to show only the relevant submissions.
By following these steps, you should be able to filter the submissions based on the selected application number effectively.