parameter query, form-based

Lifeseeker

Registered User.
Local time
Today, 13:17
Joined
Mar 18, 2011
Messages
273
Hi,

I am testing out this method, which is form-based parameter query. I have attached a copy.

There are only two fields of interest. I'm still struggling with the "is Null" in the OR field. I think that's where the problem is, but I'm not sure how to go about fixing it...

Right now, if I leave both fields empty, nothing is returned. If I only one of the fields empty, no results return. 

I'm pulling my hair out on this one. Can anybody help me?

thank you
 

Attachments

First off, why is your text like that?

Secondly, I don't think we are supposed to upload .mdb files. You need zip it first.
 
Hmm post text very odd.

It is permissable to post MDB but most prefer a zip file as you can look at it without saving to your harddisc in order to unblock.

I couldn't figure out what was wrong but on redoing the query it worked

Code:
SELECT TEST.authority, TEST.Local_region
FROM TEST
WHERE (((TEST.authority)=[forms]![search]![text0]) AND ((TEST.Local_region)=[forms]![search]![text3])) OR ((([forms]![search]![text0]) Is Null) AND (([forms]![search]![text3]) Is Null));

You should consider
1 Using a decent naming convention eg frmSearch,, qryRecords cboAuthority etc

2 Also using cascading Combo boxes as the choice of 1 limits the choice of the other, search the forum

Brian
 
Just to confirm - it is okay to post an mdb or accdb file without zipping. Although it would need to be small enough in file size to do so.
 
A light bulb came on as I looked at my code and then yours, the Parameter clause is causing your problems, you don't need it when the parameters are coming from a form, and it appears to dislike the Is Null.

I should have looked at the SQL to start with.

Brian
 
If his text didnt look like that i wouldnt have said anything. I figured he was a spammer.
 

Users who are viewing this thread

Back
Top Bottom