I have a form: FRM – AddAttributesMainFormTest (Single Form View)
that has a subform: FRM – AddAttributesTest (Datasheet View)
The record source for the main form is:
SELECT DISTINCT [TBL - PossibleAttsforItemsWithoutAtts].Page, [TBL - PossibleAttsforItemsWithoutAtts].[Proper Name], [TBL - PossibleAttsforItemsWithoutAtts].Item, [TBL - PossibleAttsforItemsWithoutAtts].Stage FROM [TBL - PossibleAttsforItemsWithoutAtts] ORDER BY [TBL - PossibleAttsforItemsWithoutAtts].Page, [TBL - PossibleAttsforItemsWithoutAtts].[Proper Name];
The record source for the subform is:
SELECT [TBL - PossibleAttsforItemsWithoutAtts].Item, [TBL - PossibleAttsforItemsWithoutAtts].Attribute, [TBL - PossibleAttsforItemsWithoutAtts].Value, [TBL - PossibleAttsforItemsWithoutAtts].[Add?] FROM [TBL - PossibleAttsforItemsWithoutAtts];
The subform is linked to the main form through Item.
This all works great when I have the data in text boxes.
Now I want to convert the Value field on the subform to a combo box and I want it only to give me the values in a query that are associated with the attribute shown in the text box. So, the row source is:
SELECT [QRY-DistinctAttsVals].Value, [QRY-DistinctAttsVals].Attribute FROM [QRY-DistinctAttsVals] WHERE ((([QRY-DistinctAttsVals].Attribute)=Forms![FRM - AddAttributesMainFormTest]![FRM - AddAttributesTest].Form!Attribute));
It actually works well, but doesn’t update when I click on the row. If I go in and out of design view, it works (i.e., updates). I know I need an event procedure, but just can’t get any to work. Here’s what I currently have for the subform:
Private Sub Form_GotFocus()
Forms![FRM - AddAttributesMainFormTest]![FRM - AddAttributesTest].Form.Requery
End Sub
Any ideas?
that has a subform: FRM – AddAttributesTest (Datasheet View)
The record source for the main form is:
SELECT DISTINCT [TBL - PossibleAttsforItemsWithoutAtts].Page, [TBL - PossibleAttsforItemsWithoutAtts].[Proper Name], [TBL - PossibleAttsforItemsWithoutAtts].Item, [TBL - PossibleAttsforItemsWithoutAtts].Stage FROM [TBL - PossibleAttsforItemsWithoutAtts] ORDER BY [TBL - PossibleAttsforItemsWithoutAtts].Page, [TBL - PossibleAttsforItemsWithoutAtts].[Proper Name];
The record source for the subform is:
SELECT [TBL - PossibleAttsforItemsWithoutAtts].Item, [TBL - PossibleAttsforItemsWithoutAtts].Attribute, [TBL - PossibleAttsforItemsWithoutAtts].Value, [TBL - PossibleAttsforItemsWithoutAtts].[Add?] FROM [TBL - PossibleAttsforItemsWithoutAtts];
The subform is linked to the main form through Item.
This all works great when I have the data in text boxes.
Now I want to convert the Value field on the subform to a combo box and I want it only to give me the values in a query that are associated with the attribute shown in the text box. So, the row source is:
SELECT [QRY-DistinctAttsVals].Value, [QRY-DistinctAttsVals].Attribute FROM [QRY-DistinctAttsVals] WHERE ((([QRY-DistinctAttsVals].Attribute)=Forms![FRM - AddAttributesMainFormTest]![FRM - AddAttributesTest].Form!Attribute));
It actually works well, but doesn’t update when I click on the row. If I go in and out of design view, it works (i.e., updates). I know I need an event procedure, but just can’t get any to work. Here’s what I currently have for the subform:
Private Sub Form_GotFocus()
Forms![FRM - AddAttributesMainFormTest]![FRM - AddAttributesTest].Form.Requery
End Sub
Any ideas?