ACC2: Event Procedure Sets Incorrect Subform FieldID: Q131882
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you use an event procedure to set a value in a subform's recordset,
Microsoft Access writes the value to the incorrect field. That is, it
writes the value to a control bound to the field specified in the subform's
LinkChildFields property rather than to the recordset field specified in
the event procedure.
The subform does not have a control that is bound to the field that the event procedure sets.
Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.
Add a control that is bound to the field that the event procedure sets to
the subform.
If you do not want the control to be displayed, you can hide it using one
of the following methods:
Sub Form_Load ()
Me![My bound control].ColumnHidden = -1
End Sub
Name: Product_Combo_Box
RowSource: Products
ColumnCount: 4
ColumnWidths: 0 in; 0 in; 0 in; 1 in
BoundColumn: 1
Sub Product_Combo_Box_AfterUpdate ()
Me![Product ID] = CLng(Me![Product_Combo_Box])
End Sub
Keywords : kbusage FmsSubf
Version : 2.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 28, 1999