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

Set Access ComboBox Default Value to First in List

I have a combo box in a subform that will have different options
depending on values in the main form.

I would like the combo box to default to the first value in the list.

Any help would be much appreciated, thanks.

Aug 24 '06 #1
1 24881
an*******@gmail.com wrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
I have a combo box in a subform that will have different
options depending on values in the main form.

I would like the combo box to default to the first value in
the list.

Any help would be much appreciated, thanks.

Easy enough to do in code of the OnCurrent Event of the subform

if me.newrecord then
me.combobox.value = me.combobox.column(index,row)
end if

Index Required Long. A long integer that can range from 0 to
the setting of the ColumnCount property minus one.

Row Optional Variant. An integer that can range from 0 to the
setting of the ListCount property minus 1.

the value for index should correspond to the bound column of the
combobox. if you have only one column and want the first row,
it's column(0,0)
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 25 '06 #2

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

Similar topics

0
by: Pierre Gecils | last post by:
I defined a default value for several element of my XML schema. When an element defined with a default value is specified as missing in the respective XML document, I do not receive the default...
2
by: Terry Bickle | last post by:
Please forgive me for using the wrong term here or there. I'm an old Excel 4 macro guy who didn't convert to VB and I'm tinkering with an Access 2000 DB. I'm sure there is a simple Access 101...
3
by: Todd D. Levy | last post by:
I have a number of Drop Down Combo Boxes where users select a country; 99% of the time the selection will be "United States". I want to use VBA code in the New Record Event to populate this field...
2
by: Fred | last post by:
Hi, I am having a problem setting a combobox value in code on form load using comboBox.SelectedValue method. The code below when debugging show the combobox equal to an undefined value. The...
2
by: chris in grimsby | last post by:
I have a combobox of dropdownlist style as one of the controls on a tabbed form. The list is populated by setting the DataSource property to a dataset and then the DisplayMember and ValueMember...
2
by: Eduardo78 | last post by:
I would like to set the default value of a combobox to "nothing" or spaces when my form loads. I am using the dropdown list property becasue i want the end-user to select only values listed in the...
6
by: carmela_wong | last post by:
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...
3
by: sharperrr | last post by:
Access2000 Hi I have a combobox which displays a list of values dependent on another field. On the fields onchange event the rowsource of the combobox changes according to the value in the...
8
Knut Ole
by: Knut Ole | last post by:
hi, i have a combobox that pulls a list from a table, and i've added a "New" button to create a new blank record in the combobox (see below). when i have a new record (ID) in the combobox however,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.