Avatar of Tony
Tony
 asked on

Combobox Requery from a different form.

Hi,
Using MS-ACCESS.

I have this:

A Form called:  FormSalesHead

Inside this Form I have a TAB.  Called:  Tab1

Inside the Tab1 I have a Subform Called: FormSalesDetail

Inside the FormSalesDetail I have a combobox called: SProductID.

Sometimes I am recording a Sale on this forms and I need to ADD a NEW item, which is not on the List of SProductID (Combobox).
Then I go to another form called Products, and there I record the new Item.

Then I come back to the Sale, but when I look in my Combobox (SProductID) the New Item is now in the list still.

I know I could solve this doing a Requery action on get the focus on this combobox, but the issue is that there are thousand of items and it will make the process slow every time this combo get the focus.

How can I requery this Combobox from the Products form (the form I use to add the Products?

I have tried this from the other form (Products):  Forms!FormSalesHead!FormSalesDetail.Form!SProductID.Requery   but not requering / working.

I also tried this: orms!FormSalesHead!FormSalesDetail.Form.Requery      > This requery the form... but not the Combobox.

Please advice.

Thank you.
Microsoft AccessVBA

Avatar of undefined
Last Comment
Tony

8/22/2022 - Mon
John Tsioumpris

Form_FormSalesDetail.SproductId.Requery

Open in new window

Daniel Pineault

Always useful for figuring out the proper syntax for this type of thing is http://theaccessweb.com/forms/frm0031.htm
SOLUTION
Dale Fye

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Gustav Brock

Your code/syntax:

Forms!FormSalesHead!FormSalesDetail.Form!SProductID.Requery 

Open in new window

is correct.
Thus, if it doesn't work, the new record is not present when you call it.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
crystal (strive4peace) - Microsoft MVP, Access

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Tony

ASKER
good.thank yoou very much.