Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: HELP!!! List box problem


Message #1 by "Cynthia Halim" <cynltd@y...> on Sun, 25 Nov 2001 09:39:18
Hi,



I have two tables, tblDirector and tblMovie. In my tblMovie, I would like 

to have some kind of a drop down menu that If I fill in my movie details 

in my tblMovie, when I want to enter the director name, I will be able to 

choose the name (without displaying the director ID), thus just the name. 



However, each director can have the same name but different ID. How do I 

display in my combo box in my tblMovie if I want to choose the director 

name : eg:



tblMovie

--------------------------------

movieId | title | directorName

--------------------------------

1234    |blah   | combo box => (?) how do I display just the name

                                   but noticing the ID

                                   Stephen Spielberg (Id : a123b3)

                                   Stephen Spielberg (Id : 23123w)

                                   Tim Burton,..etc



Please help me how to implement this problem, whether I should use form 

based on the Query(but how??) or should I use other method. I really 

appreciate the best solution for this problem.



Thanks in advance!!



regards,

Cynthia
Message #2 by "John Ruff" <papparuff@c...> on Sun, 25 Nov 2001 07:58:37 -0800
Cynthia,



Why does your tblDirector table list a director more than once?  The

director should only be in this table once.  If there is data in the

tblDirector table that causes you to create a record for a director more

than once, then you need to break the tblDirector down to at least two

tables.  One for the Director's basic info that will only have to be

entered once (tblDirector), and one for the rest of the director's data

(tblDir_Stats).



To answer your question.



1. Open the tblMovie table, select the DirectorID and press the LookUp

Tab in the Field Properties Section.

2. Select ComboBox from the drop-down list

3. In the Row Source property, select the button with the eclipses on it

(...).  This will invoke the query builder.

4. In the query builder, select the tblDirector table and add the

DirectorID and DirectorName to the query builder grid.

5. Close and save the query.

6. In the Bound Column property: 1 (The field from the tblDirector table

that is stored in this field)

7. In the Column Count property: 2 (Number of fields to display)

8. In the Column Widths property: 0;1 (Hides the DirectorID (0),

Displays the Director Name with a width of 1 inch (1))

9. In the List Width: 1 (Total width of step 8)

10. In the Limit To List property: Yes (Do not permit names that are not

in the tblDirector table)



But, because you are permitting a directory to be entered more than once

in the tblDirector table, you will display the same director multiple

times.  Using your example, if you look at the move Star Wars in the

tblMovies table, Stephen Spielberg will be displayed twice in the

Director field.  This you do not want because you don't know which

Stephen Spielberg is the correct one; a123b or 23123w.



John Ruff - The Eternal Optimist :-)







-----Original Message-----

From: Cynthia Halim [mailto:cynltd@y...] 

Sent: Sunday, November 25, 2001 9:39 AM

To: Access

Subject: [access] HELP!!! List box problem





Hi,



I have two tables, tblDirector and tblMovie. In my tblMovie, I would

like 

to have some kind of a drop down menu that If I fill in my movie details



in my tblMovie, when I want to enter the director name, I will be able

to 

choose the name (without displaying the director ID), thus just the

name. 



However, each director can have the same name but different ID. How do I



display in my combo box in my tblMovie if I want to choose the director 

name : eg:



tblMovie

--------------------------------

movieId | title | directorName

--------------------------------

1234    |blah   | combo box => (?) how do I display just the name

                                   but noticing the ID

                                   Stephen Spielberg (Id : a123b3)

                                   Stephen Spielberg (Id : 23123w)

                                   Tim Burton,..etc



Please help me how to implement this problem, whether I should use form 

based on the Query(but how??) or should I use other method. I really 

appreciate the best solution for this problem.



Thanks in advance!!



regards,

Cynthia

---

You are currently subscribed to access as: papparuff@c... To

unsubscribe send a blank email to $subst('Email.Unsub')








  Return to Index