Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field value based on prior value entered in table:

Status
Not open for further replies.

jeffcravener

Technical User
Apr 10, 2003
37
US

For practice I am creating a database for comic books.
I have created tables to hold Creators names, Publisher names, comic professions, titles, etc...

I always knew in a form you could create a listbox to display the possible values from a table that held those values.

BUT, I just discovered that I can do that in the Table....

However, to make it even more idiot proof, and easy to enter data, I want one fields value options to be based on the value entered in the previous field.
Example: If I am in Table Data entry view, my fields are in the following order:
Publisher - Title - Series - Issue - Writer - Penciller - Inker - Etc

What I want to do is this:
When you choose the Publisher, then the list box under Title will then only display comic books printed by that specific publisher...

I know how to set it up so that the listbox looks up all Titles, but there has to be a way to pass the value that is chosen in the Publisher field to the query looking up the possible Title values...

PLEASE HELP!!!

 
Suppose a table "PUBLISHERS" with a single field "Publisher" and a table "TITLES" with two fields Publisher and Title. Also a form called "Book Titles".

In the query which provides the data for the Titles ListBox include a column for Publishers and set its criteria to match the current value selected in the Publishers ListBox on the form. e.g.

SELECT DISTINCTROW TITLES.Title, TITLES.Publisher
FROM TITLES
WHERE (((TITLES.Publisher)=[Forms]![Book Titles]![LstPublishers]));

Then include in the AfterUpdate event for the Publisher ListBox the command: LstTitle.Requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top