Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!
I have an Access query question I am hoping someone can answer-
I am trying to do a query by form. I am following the Instructions here [link] which seem to indicate that the Criteria should be:Forms![frmClassPayqry]![Year] Or Forms![frmClassPayqry]![Year] Is Null
When I tab away from that field in the query in design vier, there are extra brackets added around the word form that I did not put is there. (like this [Forms]![frmClassPayqry]![Year] Or [Forms]![frmClassPayqry]![Year] Is Null) I am using the builder, so I am pretty sure I am typing it right.
When I tab away from that field in the query in design vier, there are extra brackets added around the word form that I did not put is there.
The query designer will do that, but that's fine.
Thanks Tommy. I have been trying to fix this for hours, so I feel a little DUM!
OK-
So when I enter the data I am searching for on the form, a) I am coming up with an empty qury no matter what I type, and b) when I open up the query in design view to check it, I have the [Forms]![frmClassPayqry]![NSG Number] Or [Forms]![frmClassPayqry]![NSG Number] under Criteria about 10 times per field, instead of the one I types, and It has added [Forms]![frmClassPayqry]![NSG Number] as a "field" in the columns to the right, with a whole bunch of "Is Nulls" in the bottom.
Any ideas?
Hmm... not sure what it's doing.
When you enter the criteria in the criteria field, are you putting it all in one field? and not two (because of the OR)?
(You know how in the query design form, there's multiple lines for criteria - using more than one line results in the query interpreting the two lines as being used together with an OR. But that's not what you want to do in this case - you should just be using the first line of the criteria fields. For example, one field would have this:
[Forms]![frmClassPayqry]![Year] Or [Forms]![frmClassPayqry]![Year] Is Null
in the criteria field on a single line.)
Does that make sense?
Yes, I am putting them on a single line. It looks all perfect until I try the search and it adds all this stuff!
If you just save and close the query and then reopen it in design view, is it still all screwed up?
No-- But I THINK (I am still deleting all the crap to check) that when I go into non-design view on the query it does add all the crap. And it does a Parameter Search. Also, I am actually doing this with 4 fields and the same thing is happening in each field.
Once you get everything in the query fixed the way it should be, can you switch to SQL view, copy the SQL and send it to me? or post it here?
It is also truncating some of what I typed in- so in addition to repeating it 15 times, the [Forms]![frmClassPayqry]![NSG Number] Or [Forms]![frmClassPayqry]![NSG Number] Is Null becomes [Forms]![frmClassPayqry]![NSG Number] Or [Forms]![frmClassPayqry]![NSG Number] without the Is Null.
And in another field [Forms]![frmClassPayqry]![Start Date] Or [Forms]![frmClassPayqry]![Start Date] Is Null is becoming just [Forms]![frmClassPayqry]![Start Date], without the rest of the statement
Weird. I am assuming it has something to do with the frmClassPayqry form and how it is built (with text boxes named, say NSG Number)