Link to home
Create AccountLog in
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.
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Form_FormSalesDetail.SproductId.Requery

Open in new window

Avatar of Daniel Pineault
Daniel Pineault

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

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Tony

ASKER

good.thank yoou very much.