Updates

H

HServ

Here's an easy one:
I have three tables. One has all the names and addresses in the database.
The other two have the same information but split into two categories, say
girls and boys. You can update any of te lists but the changes don't seem to
show up in the other tables. The easy answer seems to be creating a
relationship between the Primary Keys of the tables but that doesn't seem to
be working. Perhaps there is more to it? Thank you
 
C

Craig Alexander Morrison

Delete the two tables once you have set a marker in the main one to denote
the different types.

Add a Yes/No field, Yes=Girls/No=Boys. Update the marker to yes in the main
table using the Girls table.

NEVER store duplicate data unless you can manage the database consistency at
engine level, (SQL Server/DB2).
 
H

HServ

What if I have more than 2 "categories," and yes/no won't work. For example,
I have a list of songs and want to split them into 5 different styles of
music. I want to be able to open a list of all songs or open a list of just
jazz songs without having to run a query every time. Thanks
 
R

Rick Brandt

HServ said:
What if I have more than 2 "categories," and yes/no won't work. For
example, I have a list of songs and want to split them into 5
different styles of music. I want to be able to open a list of all
songs or open a list of just jazz songs without having to run a query
every time. Thanks

Then use a field that holds as many values as you need (1, 2, 3, 4, etc..)
and that can be joined to another table that gives Text descriptions for
each number. That works if the choices are mutually exclusive. In your
music example a song can easily belong in more than one category so you need
three tables. One for the tracks, one for the categories and a junction
table that stores the key combinations from the other two.

This is definitley done with queries and ONE set of data. Going around
creating multiple tables with the same structures is definitely a no-no.
 
H

HServ

I'm guessing this means a lookup wizard and that will work fine. But the
users won't want to run a query every time they open the database. I can't
see any other way for the seperate categories to be displayed without
running the query every time or creating a new table for each category. Can
I make a link, something like "View Jazz Only," and then it runs the query
without them knowing? Thanks so much for the help.
 
J

John Vinson

I'm guessing this means a lookup wizard and that will work fine. But the
users won't want to run a query every time they open the database. I can't
see any other way for the seperate categories to be displayed without
running the query every time or creating a new table for each category. Can
I make a link, something like "View Jazz Only," and then it runs the query
without them knowing?

Absolutely. Use a Parameter Query. Have a field in your table for the
category; on the Form that opens automatically (Tools... Startup...
select your startup form) put a Combo Box or Listbox allowing the user
to select a category.

Have a Query with a criterion on the category field

=Forms!frmSwitchboard!lstCategories

using the names of your form and your listbox.

Base a Form on this query (showing the information that you want to
see) and put a command button on the switchboard form to open it, or
use the listbox's AfterUpdate event to do so.

John W. Vinson[MVP]
 
Top