473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Combo box default value

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
6 8491
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
Yes, RowSource is a Value List and the control is bound. There are no
more columns.
Thanks for replying
CW

Jun 6 '06 #3
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
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
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
Thank you for your help. I understand how this works now.
Have a great day!

Jun 6 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Harry Haller | last post by:
<select name="cboPlaces" id="cboPlaces"> <option value="3">Countryside</option> <option value="4">Forest</option> <option value="5">Mountain</option> <option value="6">Desert</option> <option...
4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
0
by: northshore | last post by:
Hello, I am creating a windows application database. I have a primary table 'Individuals' and a lookup table 'Prefixes.' In the Individuals table, I have a column 'PrefixID' that references...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
3
by: Torilyn73 | last post by:
I posted this earlier... or thought I did... anyway.. it's doesn't appear in the list so I'm reposting it. Can someone please explain to me how to set up the lostfocus event for a combo box. I...
2
by: Brad Pears | last post by:
In my vb.net 2005 project I have a few combo boxes where I want to set a default value. I am not binding these combo boxes - I am loading the values directly in code from a dataset. Obviously...
2
kmartinenko
by: kmartinenko | last post by:
Hi everyone, I have several combo boxes on my form, and while I have designated a column head, I cannot figure out how to default to the column head value. What I really want is for all of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.