Query doesn't show any new records!

lallion

New member
Local time
Today, 19:03
Joined
Apr 27, 2010
Messages
3
Hiya,

I'm reasonably new to access and I've managed to muddle through coding things etc to make a (mostly!) functioning database.

My problem is this: I have a query that is run from a search form. This all works swimmingly and used to return all results when nothing was entered in the search form. I've entered more records into the table this query is linked to but when I run a search of the table only the old records show. Why is this? I've seen some references to Me.Requery and the like but I can't understand where I'm meant to put that or even if that's what I need to use?

Thanks in advance for any help! :)
 
Those didn't really show me anything that helped. My search query (filtered by text boxes and triple state checkboxes on my search form) still doesn't show me any of the results that I entered after I made the query. Even when I open the whole database up again!
 
Please post you query sql.
 
If you have criteria in the query based off a form value, you'd probably want to issue the me.requery command in the AfterUpdate of the field that the criteria in the query is based off of.

Sometimes when you don't see new records, it can be due to a blank value in the table. Consider making the criteria in the query something like this: Like Forms!MyFormName!MyFieldName & * and again, issue a me.requery in the Afterupdate event when the value is updated in the field. But this doesn't always work for integer type values.

For that, you'd do a trick in the query such as an expression like this:
MyExpression: iif(isnull(Forms!MyFormName!SearchValue),"X",Forms!MyFormName!SearchValue)
and then put criteria under this field such as: =Forms!MyFormName!SearchValue or = "X"

There are a few other tricks but we'd need to see your SQL of your query.
 
Also, if your query is based off of two (or more) tables and are linked with an INNER JOIN and there isn't a record in one of the other tables, it won't show. In that case you would need to change to an OUTER JOIN.
 
Hi everyone,


SELECT PplInfo.*
FROM PplInfo
WHERE (((PplInfo.EmpName) Like "*" & [Forms]![srchform]![NameSrch] & "*") AND (([Female]=[Forms]![srchform]![Femchk] Or IsNull([Forms]![srchform]![Femchk]))<>False) AND ((PplInfo.Location) Like "*" & [Forms]![srchform]![LocSrch] & "*") AND (([LongHair]=[Forms]![srchform]![srchLH] Or IsNull([Forms]![srchform]![srchLH]))<>False) AND ([ShortHair]=[Forms]![srchform]![srchSH] Or IsNull([Forms]![srchform]![srchSH]))<>False));

That's my SQL code. I've deleted some of the middle cos it's just loads of checkboxes with different things.

Any idea what I need to do to fix this?

Thanks!
 

Users who are viewing this thread

Back
Top Bottom