Subform Instant Refresh

Fozi

Registered User.
Local time
Today, 19:21
Joined
Feb 28, 2006
Messages
137
Hi all

I have a main form containing a control called Contact. Contained within this form is a subform containing email and Telephone numbers.

User pick a contact from the Combo box and I then want the subform to populate with their email and telephone details immediately. Currently they only populate when the user leaves the record and goes back.

I've tried working with the After Update event of the Contact control using Requery but to no avail.

All help greatly appreciated!

Thanks

Fozi
 
I'm no expert, but as long as the subform is linked correctly through Master and Child Field properties it should display the related records in the subform as soon as you go to a new record in the main form. Have you tried going to a new record manually, does it still not update the subform correctly?

It may be a problem with the after update event of the combo, please post your code.
 
Use the Afterupdate function with a refresh as opposed to a requery

Private Sub (insert contact combobox name here)_AfterUpdate()
Me.Refresh
End Sub

I use this on my DB and it works fine
 
I've tried working with the After Update event of the Contact control using Requery but to no avail.
You have to use the correct syntax. To requery the subform you would put this in the After Update event of the combo box:
Code:
Me.YourSubform[COLOR="Red"]Container[/COLOR]Name.Form.Requery
Where YourSubformContainer name is the name of the control that houses the subform on the main form and NOT necessarily the name of the subform (although it can be the same if the container control is named the same as the subform, which is it many times but isn't always).

Perhaps this will also help:
http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx
particularly paying attention to the first screenshot on how to determine the container name.
 
in the attached database I have a mock of what I'm looking to do. Two forms. One parent with subform contained.

On selecting the Project Manager I want the subform to automatically populate with the associated fax and telephone number. Equally if Project Manager changes then the subform should update instantly.

Currently when the project manager is picked nothing enters the tel and fax controls until the user moves away and returns to that record.

Thanks for all help.
 

Attachments

Users who are viewing this thread

Back
Top Bottom