Drop-down updating to subform: 2007 different than 2003

rhodesengr

Registered User.
Local time
Today, 00:55
Joined
Sep 4, 2007
Messages
14
I have a form "clients" with a drop down box "company". On the form is a subform "f_company" that shows all the comapny details. My issue is updating or refreshing or requerying the subform if I change the company in the drop down box. When I made this in Access 2003 it worked more or less intuitively. If I change the drop-down box, I would immediately see the info in the subform change to reflect the new company choice. I have looked at the properties and there is nothing in any of the event fields for either the box or the form.

When I did the same thing in Access 2007. The company info in the subform did not change unless I closed the form or went to a different record and back again. I searched the forums and found posts about putting commands in the events properties. I put a requery command in the "afterupdate" property which sort of works but I still have to click the little pencil icon in the upper left corner. I didn't do anything special in my 2003 version to get the subform to update and it works better than what I have working in 2007. I just choose the different company. Is this a known difference? Am I doing something wrong? Some setting I am missing?
 
Do you have the LinkChild/MasterFields of the SubFormControl set properly? That is what causes the syncronization of the MainForm and the SubForm.
 
Do you have the LinkChild/MasterFields of the SubFormControl set properly? That is what causes the syncronization of the MainForm and the SubForm.

What does "properly" mean? I set them when I first put the subform on the form. Is there something else? Recall from my post that as far as I know, I did the same thing in 2007 that I did in 2003. I didn't have to do anything special to get the subform to update.
 
The LinkChild/MasterFields of the SubFormControl need to point to control/fields in the Sub/Main form to make the syncronization happen. Do they? If you want to post your db we can look at it and maybe determine what is going on.
 
open the form f_clients and change the company in the drop down box. It will update the subform after you click the little pencil thingy in the upper left but it only does that because I put

=[Forms]![f_Clients]![f_Companies].[Form].[Requery]

in the afterupdate event. I never needed that in Access2003 which updates as soon as I pick a name in the drop down box. I don't even need to click the pencil thingy. I tried that command in most of the other event fields but it either worked worse or not at all. Thanks again for any help.
 
Each version of Access that is released is a little pickier than the previous version. You have the LinkMasterField set to the [Company_ID] field in the MainForm RecordSource. That field is bound to the Combo21 ComboBox that selects the Company. Technically the [Company_ID] field is not updated until you save the record and just making a selection in the ComboBox does not do that so the value of the [Company_ID] field does not change with the ComboBox. I changed the LinkMasterField to point to the Combo21 ComboBox instead and the SubForm updates. It was just MS cleaning up an oversight that has been there for years.
 
Wow. I never would have figured that out. So simple. I think there are 50 other posts on here that would have been solved by this without any me.requery stuff. You'd think the wizard would be better about making the combo box names available when you create a subform. Anyway, thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom