SELECT Performances.Perf_Date, Performances.Perf_Dancers
FROM Performances
WHERE (((Performances.Perf_Dancers) Like [Enter Search Criteria For Dancers]))
ORDER BY Performances.Perf_Date, Performances.Perf_Dancers;
Parameter [N*]
Query result looks something like this:
Perf_Date Per_Dancer
06/19/1999 Naomi
07/04/1999 Nancy
07/16/1999 Nichole
Perf_Dancers is a memo field. Each performance date above has several dancer
names
Seperated by vbCrLf .
Why?
You're having trouble because your Perf_Dancer field is not atomic. Your table
structure is not designed to work as a relational database!
A better structure would have THREE tables:
Performances
PerformanceID Primary Key
Perf_Date
<other info about the performance itself, venue, comments, etc.>
Dancers
DancerID Primary Key
LastName
FirstName
<other bio information>
Performers
PerformanceID <link to Performances>
DancerID <link to Dancers>
<other info about this dancer in this performance, e.g. role, evaluation of
performance, comments>
If the parameter selection is “N*” then only those
records with the first dancer name starting with “N” for each date is
selected the other “N”s are not shown because they were not first in the list
for that date. I want to see all dancers whose name starts with N”.
If your Perf_Dancer field contains
Alexis
Charles
Lorene
Nancy
Susan
then the search criterion
LIKE N*
will not match. The text string does NOT begin with N; it begins with A.
Access does not consider these names as five records; they are *ONE RECORD*,
consisting of a string of letters, maybe some blanks, carriage return
characters, linefeed characters. The N in Nancy is the 26th character of the
string.
Your criterion would need to be
LIKE "*N" OR LIKE Chr(13) & Chr(10) & "N*"
to find EITHER a letter N at the start of the first name, or a letter N
immediately following a carriage return-linefeed pair.