Blank Parameters

HOJU15

Registered User.
Local time
Today, 00:30
Joined
Feb 7, 2003
Messages
12
I have a table (located in) that is the middle table in a many to many.

Job=primary key
each job has a legal description or part of a legal description

legal description is 5 fields= lsd, section, township, range, meridian

the user will want to search all jobs that are in lsd 1, section 1, township 24, range 6, meridian 5

if they have all the legal descrption the query is fine BUT if they only have some problems start.

I tried using the null as and OR value but that does not work.

Basically I need to set a query that takes the parameter but if nothing is types in then returns all the records

i.e.

parameter lsd= left blank by user(should return all records)
section= 5
township=27
range=6
meridian= left blank by user (should return all records)

this query should return all records that section=5, township=27,range=6 REGARDLESS of what the records lsd and meridian are

how can I do this????????????????
 
The where clause will need to look something like:

Where (SomeField1 = Forms!YourForm!SomeField1 OR IsNull(Forms!YourForm!SomeField1)) AND (SomeField2 = Forms!YourForm!SomeField2 OR IsNull(Forms!YourForm!SomeField2)) AND (SomeField3 = Forms!YourForm!SomeField3 OR IsNull(Forms!YourForm!SomeField3)) AND ....;
 

Users who are viewing this thread

Back
Top Bottom