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 / October 2007

Tip: Looking for answers? Try searching our database.

Populate field based on combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
maryj - 29 Oct 2007 21:26 GMT
I know this shouldn't be so hard - but I'm having a brain ... or something!

On a form, I would like to select a District Number from a combo box and
have the District Name appear in a text field. My form is based on a query. I
know somehow I need to add criteria to my query to point to the info in the
combo box but I'm not sure exactly where to put this criteria. Should the
combo box field for the District Number on the form be based  on the
Districts table or is this the field that comes from the query? Or is it the
District Name field that comes from the query? I have never done this before
and am quite confused (and frustrated!!) so please give me specific
information.

A huge thank you!!!
Signature

maryj

Arvin Meyer [MVP] - 30 Oct 2007 03:04 GMT
OK, take a deep breath. It's really quite simple.

In your combobox, add the second value you want to display in the textbox.
So now the Select statement for the combo will look something like:

Select [District Number], [District Name] From MyTable;

Change the column count property of the combo from 1 to 2, and change the
column width properties to what you have now and 0" so it will look
something like:

1.5";0"

Now you've fixed the combo, all we need to do is fix the controlsource of
the textbox. That should read:

=Forms![MyFormName]![MyComboName].Column(1)

Column 1 being the second column in a zero based column index. Make sure all
the names match the names for your objects. Walla! we're done.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

>I know this shouldn't be so hard - but I'm having a brain ... or something!
>
[quoted text clipped - 13 lines]
>
> A huge thank you!!!
maryj - 30 Oct 2007 16:47 GMT
Thanks Arvin! That worked perfectly. I knew it wasn't too hard but just had a
mind block.
Signature

maryj

> OK, take a deep breath. It's really quite simple.
>
[quoted text clipped - 33 lines]
> >
> > A huge thank you!!!
 
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



©2008 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.