05-02-15, 20:58 #1Registered User
- Join Date
- Sep 2008
Unanswered: Parent/Subform filter from a bound combo box not filtering subform
I'm trying to filter a subform datasheet (subfrmProjData) based on a bound combo box (ProjectNum) in the parent form which is pulling from a query. The filter does not work. I have the Link Master/Link Child Fields set to the ProjectNum field for both forms, which are both text fields.
I have the “Data Entry” property on the main form set to “Yes”. So, when the user click on the combo box (ProjectNum) and selects the project number from the list, the data in the main form is populated, but the subform (subfrmProjData) is blank. I thought the parent/child link should work in filtering the data, but it is not working and I am not sure what is going on.
Appreciate your help. :-)
05-03-15, 20:49 #2Moderator
Provided Answers: 19
- Join Date
- Jun 2005
- Richmond, Virginia USA
First off, Comboboxes used to retrieve Records need to be Unbound, i.e. have nothing in their Control Source Properties. If it is Bound to a field in the underlying Table/Query, each time you make a selection from the Comboboxes it will create a New Record with that same ProjectNum!
The Main Form's Data Entry Property needs to be set to No. With the Data Entry Property set to Yes, there are no Records in the Form's Recordset, hence no ProjectNum is present in the Main Form to link to the ProjectNum in the Subform.
If your purpose of having the Data Entry Property set to Yes is to have a 'blank Record' on opening the Form, simply open the Main Form to a New Record. You can do that with
Private Sub Form_Load() DoCmd.GoToRecord , , acNewRec End Sub
Last edited by Missinglinq; 05-03-15 at 21:06.Hope this helps!
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007