Access can't find the field | referred to in your expression

Dazza666

Registered User.
Local time
Yesterday, 17:02
Joined
Aug 13, 2008
Messages
56
Hi,

can someone tell me whats wrong with the below statement,

DoCmd.OpenForm "ClientOverview", , , "[txtNINO]=" & [Me]![NINO]

i've compared it to other ones in my database but with this one, access keeps generating the error in the title??? i've checked the field names time and time again but can't find anything wrong.



thanks
 
If the data type of the field is text, it would need to be

DoCmd.OpenForm "ClientOverview", , , "[txtNINO]='" & [Me]![NINO] & "'"
 
If the data type of the field is text, it would need to be

DoCmd.OpenForm "ClientOverview", , , "[txtNINO]='" & [Me]![NINO] & "'"

Hi thanks for the response, but it still gives me the same error even after I adjusted it

Also, i've put the following in to a MACRO with the open form action to try and get the same result

"txtNINO='" & [NINO] & "'"

the form opens successfully but ignores the above where condition. it's like it doesn't even bother checking it?
 
Last edited:
isthere a field "txtnino" in the form (or in the form's query - not sure which)

does [nino] have a value in the current form

also try adding spaces around the = sign

"txtNINO = '" & [NINO] & "'"
 
isthere a field "txtnino" in the form (or in the form's query - not sure which)

does [nino] have a value in the current form

also try adding spaces around the = sign

"txtNINO = '" & [NINO] & "'"

Hey,

i've kinda got it working, it seems to work if the form is already open so since it is used to search the main form I made it a modal/popup form that can be opened from within the main form i'm trying to query, it seems to work ok like this

cheers
 

Users who are viewing this thread

Back
Top Bottom