Requery A Combo Box

Leesha
BronzeLounger
Posts: 1484
Joined: 05 Feb 2010, 22:25

Requery A Combo Box

Post by Leesha »

Hi,
I have a combo box [cmbStoreNO] is attached to a query that filters the store numbers based on a date range. Since new store numbers can be added at any time, I need to be sure that the store number is in the query. I tried using me.cmbstoreno.requery on the before update and on enter but I get an error saying that the you must save the current field before requerying. What would the code for that look like? Or is there a better way to do this.
Thanks
Leesha

User avatar
HansV
Administrator
Posts: 78369
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Requery A Combo Box

Post by HansV »

On the Before Update and On Enter event of the combo box itself?

Wouldn't it be sufficient to requery the combo box in the On Current event of the form?
Best wishes,
Hans

Leesha
BronzeLounger
Posts: 1484
Joined: 05 Feb 2010, 22:25

Re: Requery A Combo Box

Post by Leesha »

Hi Hans,
The form that has the combo box that is causing the issue is frmSwitchboard. It allows the user perform quite a few number of operations. cmbStoreNo only shows stores that have invoices that have been generated. Each time a group of invoices are generated the combo box should update. Will the current event of the form do that?
Thanks,
Leesha

User avatar
HansV
Administrator
Posts: 78369
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Requery A Combo Box

Post by HansV »

Is frmSwitchboard a "traditional" switchboard, with a table such as Switchboard Items as record source?
Best wishes,
Hans

Leesha
BronzeLounger
Posts: 1484
Joined: 05 Feb 2010, 22:25

Re: Requery A Combo Box

Post by Leesha »

No it is just a form that I've called frmSwitchboard that acts as a navigator for multiple controls and reports. It is not bound to anything.