Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Combo with values from unsaved records

Status
Not open for further replies.

djayam

Technical User
Aug 16, 2005
95
GB
Hi All,

I have searched through and not found anything to help me on this so here goes.

I have a combo box that lists [OrderID] and [OrderDate] for all orders WHERE [Orders].[CustomerID] = the CustomerID control on the form. The "On Enter" code is...

Me.Combo145.Requery
Me.Combo145.Dropdown

...so that it updates with any recently changed values. However, a situation is constantly arising where a user goes to a certain order (record) in the form, changes the [OrderDate] and then clicks straight back on the Combo box - the [OrderDate] hasn't updated yet as the record is still in edit mode.

I have tried shifting the focus to a subform then back again to the combo box in the "On Enter" code but it doesn't work. Any ideas on a better way?

Cheers,

Jason
 
Jason,

Requery the combo box on the date field's AfterUpDate event.

Cheers,
Bill
 
Hi Bill,

Doesn't work mate. The Combo box doesn't change.

Cheers,

Jason
 
Sorted it. Added:

DoCmd.RunCommand acCmdSaveRecord

to the AfterUpdate event

Cheers,

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top