Thank you for your response Bradley.
I actually found the error to be in the SQL string used as the cboPCZip.recordsource.
Bradley, I looked at the web sites you have developed and was facinated by the fact that they are based on, I presume, an Access
database; I beleive the Access Web also uses this technique. Could you give me some information on how you learned to do this, i.e.,
books read, courses taken, articles read, etc.
I would really appreciate hearing back from you.
--
Barry Edmund Wright
Microsoft Access Developer
301-100 Spadina Rd.
Toronto, Ontario M5R 2T7
Phone: 1-416-921-7082
E-mail:
ba*****************@NOSPAMrogers.com
"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message news:40******@nexus.comcen.com.au...
"Barry Edmund Wright" <ba*****************@NOSPAMrogers.com> wrote in
message news:hS************@twister01.bloor.is.net.cable.r ogers.com...
I would really appreciate your assistance.
I am using Access 2000 to create a form that Lists Names and Addresses
based on a number of selection criteria one of which is a combo box cboPCZip.
All the selection criteria are used to build a Where clause (strWhere1).
If optBeginsContains = 1 Then 'Return records Beginning with the value in
cboPCZip
strWhere1 = strWhere1 & " And ((tblAddress.strPCZip) like """ &
cboPCZip & "*"")"
Else 'Return records Containing the value in cboPCZip
strWhere1 = strWhere1 & " And ((tblAddress.strPCZip) like """ & "*" &
cboPCZip & "*"")"
End If
Problem:
If cboPCZip is NOT a Number, i.e., 1234-4235 records are found and
returned. However if cboPCZip isNumeric, i.e., 12344235 no records are returned,
even though there are Address records where the PCZip field contains the zip
code 12344235.
For Example:
This does NOT work: Where ((tblAddress.strPCZip) like "12344235*")
This does work: Where ((tblAddress.strPCZip) like "1234-4235*")
What am I doing wrong?
Thanks for your help!
I suspec tthe LIKE operator only works for strings/text? When you insert a
dash (-) Access probably assumes it is a string.
Maybe insert some single quotes around your value?
Where ((tblAddress.strPCZip) like "'12344235*'")
--
Bradley
Software Developer
www.hrsystems.com.au
A Christian Response
www.pastornet.net.au/response