View Full Version : Refreshing Data on display


Xenix
01-09-2002, 02:58 AM
I have a main Form called Customer and a subform which is called Contacts.

now when I select a contact for a customer it works fine, but when I change the customer and goto select a contact the combo box doe's not refresh to reflect the change of customer code. If I put a button on the screen to refresh this works fine. but I don't want to have to press a button everytime I select a new customer. Anyone know how to do a Refresh to a subform when I change the data on my main form?

Thanks
Mike

Rich
01-09-2002, 04:18 AM
In the after update of Customer put Me.Refresh or Me.Requery

Xenix
01-09-2002, 04:44 AM
I have tried this but it still don't work http://www.access-programmers.co.uk/ubb/frown.gif
I got this before the combo box info:

Private Sub Combo12_AfterUpdate()
On Error GoTo Combo12_Err
Dim rs As Object
Me.refresh

Set rs = Me.Recordset.Clone
rs.FindFirst "[Contactname] = '" & Me![Combo12] & "'"
Me.Bookmark = rs.Bookmark
Combo12_Err_Exit:
Exit Sub
Combo12_Err:
MsgBox "No Contacts Setup for this Customer"
Resume Combo12_Err_Exit
End Sub

Is there a way I can tell my main form to refresh the subform on the main form details change?

Thanks
Mike

Rich
01-09-2002, 06:07 AM
Not really sure I understand your problem, if the subform is linked to the main correctly the subform records should move accordingly. How are the forms linked?