updating one field from another

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I have an edit form that when the txtbox for the zip code is changed/entered,
I would like to have cboArea update automatically. I have put the following
in the On Exit of the txtbox;

Me.cboArea = Me.cboArea.Column(1)

Column 1 (starting with 0) is the column I want to have added/updated. Also
tried the above code line in the On Current of the edit form. Neither of
these are working. Am I missing something?

Thanks for reviewing this.

.... John
 
A combobox's columns come from the RowSource query for that combobox. You
cannot change the data in the form itself for the combobox's Columns. You
must change the data in the table, then requery the combobox so that it
displays the updated data. This also will cause the combobox to be "reset"
to the first value in the list, so you might need to also run code to set
the combobox to the desired value after the requery.

To give more specific suggestions, you'll need to give us more details about
what your form's purpose and use are.
 
Usually you just requery the combo box to update it.

Me.cboArea.Requery


HTH
 
I have an edit form that when the txtbox for the zip code is changed/entered,
I would like to have cboArea update automatically. I have put the following
in the On Exit of the txtbox;

Me.cboArea = Me.cboArea.Column(1)

Column 1 (starting with 0) is the column I want to have added/updated. Also
tried the above code line in the On Current of the edit form. Neither of
these are working. Am I missing something?

Thanks for reviewing this.

... John

This is making no sense to me. You are setting the value of cboArea to the
value of cboArea???

Do you need to use the combo's Not In List event, or what? What's the
Rowsource of the combo; its Control Source; and the bound column?

John W. Vinson [MVP]
 

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

Back
Top