Combobox isn't doing requery

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I have a combobox set LimitToList = No

On the AfterUpdate event I have the following code


cboTitle.Requery

However, it doesn't requery til the form is closed and opened again. What's
wrong?
 
Never mind, I think I know what is wrong. The combobox rowsource is a
Select Distinct so since I'm doing this in a new record, it hasn't been
saved yet so the value isn't in the table.
 
have the same problem.... a combo box in the main form should update the
subform, even on existing records. It does not until, like yours it is
reopened.
How or what do I need to change? And why?

JB

Karen said:
Never mind, I think I know what is wrong. The combobox rowsource is a
Select Distinct so since I'm doing this in a new record, it hasn't been
saved yet so the value isn't in the table.
 
You can save the current record using
DoCmd.RunCommand acCmdSaveRecord
OR
Me.Dirty=False
A requery will then show the new data.

HTH
- Turtle

Joe Bloggs said:
have the same problem.... a combo box in the main form should update the
subform, even on existing records. It does not until, like yours it is
reopened.
How or what do I need to change? And why?

JB
 
Thank you very much. I've tried docmd.save and that killed the app and then
today I tried recordset.save and that killed the app. You suggestion works
perfectly.
 
Back
Top