adding to a combo box

indesisiv

Access - What's that?
Local time
Today, 03:10
Joined
Jun 13, 2002
Messages
265
OK. Here is the problem:

I have a combo box that as a row source is based on a seperate table.
On the not in list even to open up a form to enter (in this case) a name and address.

After this i close the form but the combo box does not update.
I tried using a requery as i closed the form but it asks me to make sure the record is saved.

I am using Forms!frmService!childUnits.Form!MainUnit.Requery

Any help, advice or tips much appreciated.
Steve
 
When you open the form to enter details are you opening it up as a Dialog or just normal?

If you open it as Dialog then the code after the OPenForm doesn not execute until the form is closed (and in that case the list will be ready to be requeried) otherwise the combo is being requeried before you enter the new details.
 
I have tried that but it is the actual combo box that says the error. That is the one with the not in list event that i am using to fire the open form.

It is the same error still.

I think it i will have to use an unbound cboBox to do the initial selection.

Steve
 
You never said it was an error in your original post - you just said, basically, it wasn't working the way you expected.

What's the error message?
 
The error is:

You must save the field before you run the requery action.
 
What's your code?


On your NotInList event...
On your form close (if any)
 
On not in list :

DoCmd.OpenForm "frmAddressOfUnit", acNormal, , , acFormAdd, acDialog
Me.MainUnit.Requery


there is not code on the close of the other form.

Steve
 

Users who are viewing this thread

Back
Top Bottom