K
karen scheu via AccessMonster.com
I have a main form with an order number combo box selection. On the after
update event of the combo box, I set a filter on the recordsource and the
txt controls on the form are populated.
Private Sub cboOrder_AfterUpdate()
Dim strFilter As String
On Error GoTo Err_cboOrder
' Set the filter for the Main form
If Not IsNull(Me.cboOrder) Then
Me.Filter = "SDDOCO = " & Me!cboOrder
Me.FilterOn = True
End If
End Sub
(The record source is a query that joins an orders table with a comments
table. Some fields from the comments table will be displayed on the form.
Works perfectly. Now I have a button that enables the user to update the
fields from the comments table. They click the button and a form pops up.
I have a macro that opens the form with filter set on the order number.
The user changes any of four fields from the comments table and when the
update form closes, the orders form still displays the old values for the
comments fields. If I select the same order from the combo box, the fields
are then refreshed since I have code in the afterupdate event of the combo
that sets the filter to the order selection.
What is the best way to force the filter to be set once the update form
closes. I can't get this to work.
Thanks,
Karen
update event of the combo box, I set a filter on the recordsource and the
txt controls on the form are populated.
Private Sub cboOrder_AfterUpdate()
Dim strFilter As String
On Error GoTo Err_cboOrder
' Set the filter for the Main form
If Not IsNull(Me.cboOrder) Then
Me.Filter = "SDDOCO = " & Me!cboOrder
Me.FilterOn = True
End If
End Sub
(The record source is a query that joins an orders table with a comments
table. Some fields from the comments table will be displayed on the form.
Works perfectly. Now I have a button that enables the user to update the
fields from the comments table. They click the button and a form pops up.
I have a macro that opens the form with filter set on the order number.
The user changes any of four fields from the comments table and when the
update form closes, the orders form still displays the old values for the
comments fields. If I select the same order from the combo box, the fields
are then refreshed since I have code in the afterupdate event of the combo
that sets the filter to the order selection.
What is the best way to force the filter to be set once the update form
closes. I can't get this to work.
Thanks,
Karen