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 / New Users / February 2006

Tip: Looking for answers? Try searching our database.

Auto Add Data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Calder - 31 Jan 2006 07:06 GMT
Hi

I run Win2k with Access 2k. I have posted this question a couple of times
and although people have tried to help me I just dont get it. This is my
problem;

I have a table called "Colours"

In column 1 (called Code) I have a unique number ie EX90028-D
In column 2 (called Colours) I have a colour ie Green

EXAMPLE:

Column 1           Column 2

Code                 Colour
EX90028-D        GREEN
EX90029-D        RED
EX90030-D        BLUE

Colum 1 is designated the primary key

I have a query called Colours which includes both Column 1 and Column 2

I want to create a form that has a Combo box that lists the Codes and a text
box that automatically lists the corresponding colour to which ever code is
selcted in the Combo box.

I apologise for any inconvienence that I have put people through with this
issue. Would it be possible for anyone to email me and example of this so
that I could work it out along with any explanation that is given to me?

My email addess is john.calder@bluescopesteel.com

Thank You

John
Duane Hookom - 31 Jan 2006 13:29 GMT
Your combo box should have these properties:
Name: cboCodeColour
Row Source:
 SELECT Code, Colour
 FROM Colours
 Order By Code;
Column Count: 2
Bound Column: 1
Column Widths: 1,0

Add a text box to your form and set its control source to:
=cboCodeColour!Column(1)

Signature

Duane Hookom
MS Access MVP
--

> Hi
>
[quoted text clipped - 35 lines]
>
> John
Jeff Boyce - 31 Jan 2006 13:39 GMT
John

Your form has two fields, a combo box and a text box.

Your combo box is based on a query that returns two columns, the Code and
the Colour.

In your combo box's AfterUpdate event you add an expression something like:

   Me!YourTextBoxName = Me!YourComboBoxName.Column(1)

This will put the Colour in the textbox after you select a Code.

Now, why do you want to keep the Code displayed?  If you actual, eventual
aim is to let people pick an actual Colour, then you can do it in a single
combo box.

Use the Column Width property of the combo box and set it to something like:

   0;1

This stores the Code, but displays the Colour.  And it has the advantage of
allowing the user to select by the name of the Colour, rather than by some
hard-to-remember Code.

Signature

Regards

Jeff Boyce
<Office/Access MVP>

> Hi
>
[quoted text clipped - 33 lines]
>
> John
John Calder - 31 Jan 2006 20:04 GMT
Thanks for all your help.

Jeff, I work in the Painted Steel industry so the reason I have the opted
for the code to retain itself and the colour to display automatically is that
this database is being designed for production employees that are very
familiar with "paint codes" (of which there are over 900). There may be 5 or
6 entries during a shift that has the same code and colour but the rest of
the information (which I will add to the database) may change 4 or 5 times.
It is just to save the user from re-entering the code & colour every single
time they have an entry. Hope this helps you understand my reasons for doing
this way.

Thanks again

> John
>
[quoted text clipped - 60 lines]
> >
> > John
Jeff Boyce - 01 Feb 2006 13:16 GMT
Thanks for the further explanation, John.

It was only a thought, and it sounds like your setup works in your
situation.

Regards

Jeff Boyce
<Office/Access MVP>

> Thanks for all your help.
>
[quoted text clipped - 74 lines]
> > >
> > > John
Bob Miller - 31 Jan 2006 14:25 GMT
With the form in Design view, make sure the Controls Wizard is active
(the button on the Controls Toolbar with the magic wand.)
Select the ComboBox control, move the cursor to where you want it on
your form and left click once.  You will be stepped through the
creation of you Combobox.

John Calder Wrote:
> Hi
>
[quoted text clipped - 41 lines]
>
> John

Signature

Bob Miller

 
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.