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

Combo Box - Default Values ?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.