Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string type mismatch

Status
Not open for further replies.

trustsun

Technical User
Feb 4, 2004
73
US
Hello everyone, could you help me to revise this string filter code. I'm getting a type mismatch because the values are numbers.

strFilter = strFilter & "[NBR]=" & Nz("'" + Me![cmbme] + "'", "[NBR]")

I need it to filter by number values.

-Thanks
 
Your objective isn't real clear from your expression. Maybe try something like:
strFilter = strFilter & "[NBR]=" & Nz(Me![cmbme], [NBR])


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Perhaps something like this ?
If IsNumeric(Me![cmbme]) Then
strFilter = strFilter & "[NBR]=" & Me![cmbme]
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top