By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Combo box default value

P: n/a
Hello all,

I am trying to set the default value of a combo box to "USA" which does
not work although I have entered this in the Default Value property of
the control. The combo box shows the values "USA", "Canada" and "Mexico
in the drop-down menu. I am able to accomplish this in a list box but
that is not what I want. I need the combo box.

Thank you for any advice.
CW

Jun 6 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
ca**********@hotmail.com wrote:
Hello all,

I am trying to set the default value of a combo box to "USA" which
does not work although I have entered this in the Default Value
property of the control. The combo box shows the values "USA",
"Canada" and "Mexico in the drop-down menu. I am able to accomplish
this in a list box but that is not what I want. I need the combo box.

Thank you for any advice.
CW


Is the RowSource a ValueList?

Is the control Bound?

Is there more than one column (including hidden ones)?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 6 '06 #2

P: n/a
Yes, RowSource is a Value List and the control is bound. There are no
more columns.
Thanks for replying
CW

Jun 6 '06 #3

P: n/a
ca**********@hotmail.com wrote:
Yes, RowSource is a Value List and the control is bound. There are no
more columns.
Thanks for replying
CW


And you are definitely moving to a new record when opening the form?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 6 '06 #4

P: n/a
Here is what happens: I look up an Order number on the main form. The
subform shows all the line items for that order. It is that subform
that has the combo box. I want it to show USA as the default which then
gets saved in the country field of each record for the order. Country
could be changed to Canada or Mexico prior to saving. The wierd thing I
just noticed is that the value does not get saved in the country field
unless I go and select country value for each line individually. It
does not just save the default value in the field.
Thanks

Jun 6 '06 #5

P: n/a
ca**********@hotmail.com wrote:
Here is what happens: I look up an Order number on the main form. The
subform shows all the line items for that order. It is that subform
that has the combo box. I want it to show USA as the default which
then gets saved in the country field of each record for the order.
Country could be changed to Canada or Mexico prior to saving. The
wierd thing I just noticed is that the value does not get saved in
the country field unless I go and select country value for each line
individually. It does not just save the default value in the field.
Thanks


The default value only applies to NEW records. If you added this field and
ComboBox and then look at existing orders it is going to still show null
because that is the value stored in those records. If you look at the last
"new record" row on your subform you should see the default value show up
there.

For existing records you would need to run an update query to set them all
to USA and then you could use the ComboBox on individual records that needed
to be set to something else.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 6 '06 #6

P: n/a
Thank you for your help. I understand how this works now.
Have a great day!

Jun 6 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.