M
maryrb
Hello,
I'm very new to Access, and have been struggling to get what seems to
me a very simple database to work correctly.
I've got just one table, and each record contains only nine fields
(including the primary key). The fields are all text, except for one
that is memo.
What I'd like to be able to do is build a form with input boxes for
seven of the fields that will launch a multiple parameter query. I'll
never be putting search terms into all of the fields on the form, but
I'll often be using different fields for different searches.
Seems like a fairly straightforward project. But I'm having trouble
with the query. Even without using the form, it will only return proper
results on data entered into the first two parameters. No results are
returned for anything that I enter into the last five parameters
(although i do get proper returns when i build simple single-parameter
queries for each of the fields).
So ... here's the SQL I've got. From all the SQL stuff i've been poring
over, I think I'm using AND correctly, but Access obviously doesn't
think so.
SELECT [Bridge Transcripts].TP, [Bridge Transcripts].TC, [Bridge
Transcripts].SPKR, [Bridge Transcripts].TRANSCRIPT, [Bridge
Transcripts].STARS, [Bridge Transcripts].WITH, [Bridge
Transcripts].KEYWORDS, [Bridge Transcripts].LOC, [Bridge
Transcripts].ID
FROM [Bridge Transcripts]
WHERE ([Bridge Transcripts].[TP] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![TP] Is Null)
AND ([Bridge Transcripts].[SPKR] = [Forms]![BTF]![SPKR] Or
[Forms]![BTF]![SPKR] Is Null)
AND ([Bridge Transcripts].[TRANSCRIPT] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![TRANSCRIPT] Is Null)
AND ([Bridge Transcripts].[STARS] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![STARS] Is Null)
AND ([Bridge Transcripts].[WITH] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![WITH] Is Null)
AND ([Bridge Transcripts].[KEYWORDS]= [Forms]![BTF]![TP] Or
[Forms]![BTF]![KEYWORDS] Is Null)
AND ([Bridge Transcripts].[LOC] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![LOC] Is Null);
Any help greatly appreciated.
-Mary
I'm very new to Access, and have been struggling to get what seems to
me a very simple database to work correctly.
I've got just one table, and each record contains only nine fields
(including the primary key). The fields are all text, except for one
that is memo.
What I'd like to be able to do is build a form with input boxes for
seven of the fields that will launch a multiple parameter query. I'll
never be putting search terms into all of the fields on the form, but
I'll often be using different fields for different searches.
Seems like a fairly straightforward project. But I'm having trouble
with the query. Even without using the form, it will only return proper
results on data entered into the first two parameters. No results are
returned for anything that I enter into the last five parameters
(although i do get proper returns when i build simple single-parameter
queries for each of the fields).
So ... here's the SQL I've got. From all the SQL stuff i've been poring
over, I think I'm using AND correctly, but Access obviously doesn't
think so.
SELECT [Bridge Transcripts].TP, [Bridge Transcripts].TC, [Bridge
Transcripts].SPKR, [Bridge Transcripts].TRANSCRIPT, [Bridge
Transcripts].STARS, [Bridge Transcripts].WITH, [Bridge
Transcripts].KEYWORDS, [Bridge Transcripts].LOC, [Bridge
Transcripts].ID
FROM [Bridge Transcripts]
WHERE ([Bridge Transcripts].[TP] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![TP] Is Null)
AND ([Bridge Transcripts].[SPKR] = [Forms]![BTF]![SPKR] Or
[Forms]![BTF]![SPKR] Is Null)
AND ([Bridge Transcripts].[TRANSCRIPT] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![TRANSCRIPT] Is Null)
AND ([Bridge Transcripts].[STARS] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![STARS] Is Null)
AND ([Bridge Transcripts].[WITH] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![WITH] Is Null)
AND ([Bridge Transcripts].[KEYWORDS]= [Forms]![BTF]![TP] Or
[Forms]![BTF]![KEYWORDS] Is Null)
AND ([Bridge Transcripts].[LOC] = [Forms]![BTF]![TP] Or
[Forms]![BTF]![LOC] Is Null);
Any help greatly appreciated.
-Mary