changing default value

R

RipperT

I have a form in datasheet view with 2 fields that are cbo boxes with a list
of values to choose from. One field just has 8 or 9 from which to choose,
the other is thousands. I would like to set up a form/subform in which the
user will be able to first select one of these 8 or 9 values in maybe an
unbound cbobox, thereby setting it as the default value while they enter
some records, then change it to another default value etc. How can I do
this?

Many thanx,

Rip
 
T

tina

create a main form, add an unbound combo box control (which i'll call
cboChoice), and set the control's RowSource property the same as the combo
box control in your "current" form (the form you described in your post).
add your "current" form to the main form, as a subform. in the subform's
form BeforeInsert event procedure, add code to set the value of the combo
box control on the subform to whatever value was selected in the unbound
combo box control on the main form, as

Me!ComboBoxName = Me.Parent!cboChoice

substitute the correct name of the combo box control on the subform, of
course.

hth
 
R

RipperT

Worked like a charm. Many thanx,

Rip

tina said:
create a main form, add an unbound combo box control (which i'll call
cboChoice), and set the control's RowSource property the same as the combo
box control in your "current" form (the form you described in your post).
add your "current" form to the main form, as a subform. in the subform's
form BeforeInsert event procedure, add code to set the value of the combo
box control on the subform to whatever value was selected in the unbound
combo box control on the main form, as

Me!ComboBoxName = Me.Parent!cboChoice

substitute the correct name of the combo box control on the subform, of
course.

hth
 

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