473,394 Members | 1,740 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,394 software developers and data experts.

Combo Box - Default Values ?

I have a table of Country names & Country codes in alphabetical order.

This is a lookup table that a number of other tables use to populate the
Country field via a drop down Combo Box on the form(s) for the table(s)
in question.

The "United States" Country name & the "US" Country code are selected
99% of the time.

I would like to have the "United States" & "US" be the default values
for these fields such that these values appear in these fields
automatically whenever a new record is created.

I would prefer not to disturb the alphabetical order in the Country
table.

I have set the default value properties both at the table level and for
the individual controls (Combo Boxes) on the forms.

While the values I want seem to be appearing in new records at the table
level, these values are not appearing in the controls (Combo Boxes) at
the form level.

I'm sure I am missing something simple here; how can I get the behavior
I am looking for?
Nov 12 '05 #1
2 10035
Hi, Todd:

The way default values work on forms, if you create a record via code (as
opposed to coming to a blank record on the form and starting to fill in), it
doesn't use the default values. So if you've done any code manipulation when
you start the record, the default value won't fire. Backup solution can be to
set the country when you're handling the code at the beginning; then the user
can always change it.

HTH

Jan
I have a table of Country names & Country codes in alphabetical order.

This is a lookup table that a number of other tables use to populate the
Country field via a drop down Combo Box on the form(s) for the table(s)
in question.

The "United States" Country name & the "US" Country code are selected
99% of the time.

I would like to have the "United States" & "US" be the default values
for these fields such that these values appear in these fields
automatically whenever a new record is created.

I would prefer not to disturb the alphabetical order in the Country
table.

I have set the default value properties both at the table level and for
the individual controls (Combo Boxes) on the forms.

While the values I want seem to be appearing in new records at the table
level, these values are not appearing in the controls (Combo Boxes) at
the form level.

I'm sure I am missing something simple here; how can I get the behavior
I am looking for?


Jan Stempel
Stempel Consulting
Nov 12 '05 #2
Todd,

Here's something to consider doing ---

Create a query that includes country name and country code and set the country
code criteria for the US country code so that the query only includes US. Create
a second query that includes country name and country code and set the country
code criteria to NOT the country code for US so this query returns all countries
but the US. Set the sort to Ascending on Country Name. Then create a Union query
that includes these two queries with the first query as the first query in the
Union. This will give you US at the top of the list with all other countries in
alpha order. Now the users can easily select US because it is at the top of the
list.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Todd D. Levy" <us**************@spamex.com> wrote in message
news:MP************************@nyc.news.speakeasy .net...
I have a table of Country names & Country codes in alphabetical order.

This is a lookup table that a number of other tables use to populate the
Country field via a drop down Combo Box on the form(s) for the table(s)
in question.

The "United States" Country name & the "US" Country code are selected
99% of the time.

I would like to have the "United States" & "US" be the default values
for these fields such that these values appear in these fields
automatically whenever a new record is created.

I would prefer not to disturb the alphabetical order in the Country
table.

I have set the default value properties both at the table level and for
the individual controls (Combo Boxes) on the forms.

While the values I want seem to be appearing in new records at the table
level, these values are not appearing in the controls (Combo Boxes) at
the form level.

I'm sure I am missing something simple here; how can I get the behavior
I am looking for?

Nov 12 '05 #3

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...
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...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.