Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / January 2007

Tip: Looking for answers? Try searching our database.

setting up a combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
winty03 - 08 Jan 2007 18:04 GMT
I am having a probelm with a combo box in a form.  I have created a
form for a certian table.in this form I have a combo box drop down....I
have selected the table for the drop down but it is grabbing or using
the first field in the table which is an auto number, and I want it to
use the next field ..field 2 that has names in it.  How can I tell the
combo to use the 2nd field in that table versus the first.  Thanks Chris
ruralguy - 08 Jan 2007 18:25 GMT
The answer to your question is change the bound column of the ComboBox. It is
on the Data tab of the properties sheet for the ComboBox and is 0 based.

I suspect you have a design issue if you are putting the same text in more
than one table.  You may wish to review normalization.

>I am having a probelm with a combo box in a form.  I have created a
>form for a certian table.in this form I have a combo box drop down....I
>have selected the table for the drop down but it is grabbing or using
>the first field in the table which is an auto number, and I want it to
>use the next field ..field 2 that has names in it.  How can I tell the
>combo to use the 2nd field in that table versus the first.  Thanks Chris

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Al Campagna - 08 Jan 2007 18:34 GMT
Chris,
  Sounds like you've asked the combo to use the Table as the RowSource...
  Select Query instead, and using the query design grid... set up the fields you want in
the colums you want.

  But... say your selecting a Customer for a transaction of some sort.  You shouldn't
capture the "CustName", you should capture the CustID (unique key for each Customer.
Duplicate names can exist, so your heading for problems eventually.
  The table your using to gather this data should have a CustID field, and your combo
should be bound to that field.

   Setup the combo (ex. name = cboCustID) this way.
   ControlSource = CustID
   Col1 = CustID, Col2 = CustName
   NumberOfCols = 2
   ColumnWidths = 0"; 2"  (hides the CustID from the user)
   ListWidth = 2"

   Okay, here's what happens...
   The combo just "displays" all the CustNames, the user selects a CustName, the combo
"displays" that name... but in reality, CustID is stored in your form table in the CustID
field.  This does double duty... easy for the user to select a name, but really capture
the CustID... which is the key value that will allow you to always relate the data your
capturing back to "one and only one" Customer.

Signature

hth
Al Campagna
Candia Computer Consulting
Microsoft Access MVP - Candia, NH USA
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

>I am having a probelm with a combo box in a form.  I have created a
> form for a certian table.in this form I have a combo box drop down....I
> have selected the table for the drop down but it is grabbing or using
> the first field in the table which is an auto number, and I want it to
> use the next field ..field 2 that has names in it.  How can I tell the
> combo to use the 2nd field in that table versus the first.  Thanks Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.