Combobox isn't doing requery

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?
 
K

Karen

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.
 
J

Joe Bloggs

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.
 
M

MacDermott

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
 
K

Karen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top