rst.nomatch always returns TRUE

I had this question after viewing type mismatch on rst.findfirst.
On my app, I have a rst with a value and I am always getting a .nomatch situation in spite of the record being there (a match occurs)

van anyone help?



Screen-Shot-2017-10-27-at-12.41.28.png

Screen-Shot-2017-10-27-at-12.41.28.png
João serras-pereiraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
Compare it value with true or false..

IF _rst.NoMatch  = True
...
Else
...
End IF
0
Gustav BrockCIOCommented:
Adjust your filter:

strLocateSelected = "CodMilitante = '" & qryMMRfilterNew_rst!CodMilitante.Value & "' And refSelecaoMaster = '" & Me!frmfld_refSelecao.Value & "'"

Open in new window

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeCommented:
You should not have to test for "=True" because the NoMatch property returns a boolean and should not need an "=True" test.

The first thing I would do is print out the criteria string you are using for the FindFirst method; do this right after setting your strLocateSelected value.

debug.print strLocateSelected

Then I would create a query that uses the query you are using for your recordset as its source and add the criteria that was printed in the previous step to the query, to determine whether it actually returns a record.

If not, then rs.nomatch is working properly.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

João serras-pereiraAuthor Commented:
Hi (Gustav)
Now I am getting a novel error:

Screen-Shot-2017-10-27-at-13.47.05.png
Screen-Shot-2017-10-27-at-13.48.18.png
0
aikimarkCommented:
in the Immediate window, use "?" instead of "debug.print"
0
Dale FyeCommented:
that particular error explicitly indicates that the [CodMilitante] field does not exist in the recordset that you are using the FindFirst method against.
0
Gustav BrockCIOCommented:
Yes, that field is missing or misspelled, either in your recordset or in the query.

/gustav
0
João serras-pereiraAuthor Commented:
righto and thanks!!!!! I had a misspeleld nam as welll... THANKS for helping mme!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.