show new record after combo box update

A

AndrewL

Hi, I want my combo box to automatically update with the new record.

I have a form with a combo box and a command button for new records.
The coding for the command button includes
Me![Combo228].Requery

.... and this populates the combo box with the new entry. But I then
have to select the combo box and choose the new entry to update the
record. I want the record updated automatically, without any further
effort from me.

Any ideas?

thanks
AndrewL
 
D

Dale Fye

Andrew,

If you expect Access to select a value for you in your combo box, when you
go to a new record, then you need to set the combo boxes default value. If
you want it to be the same as for the last record you were on, then early in
your cmdNewRecord code, you should set the controls default value to it's
current value. Something like:

me.combo228.DefaultValue = me.comb0228

BTW, if you would establish a control naming convention, it would be a lot
easier to read your code. Six months from now, when you are trying to debug
your code, you're going to ask yourself "What the hell is combo228?"

HTH
Dale
 

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