G
Guest
Hi,
I have a form that is based on a query, i use this form to group customers
together based on warranty claims they have made. One customer can have
several claims and some customers will have un resolved claims. It is
important for me to count these records based on two fields, customer name
and a certain status of their claim. This is what my code looks like so far
and it mainly works...
Let cn = [CustomerName]
intx = DCount("[StatusID]", "qryfrm", "[Customername] = '" & cn & "' AND
[statusid] = 2")
inty = DCount("[StatusID]", "qryfrm", "[CustomerName] = '" & cn & "' ")
[count1] = inty
My probem happens when a customes name has a ' in it such as Captain's
Marine. The ' seems to be seen as part of the code and i get a error message
when i try to count the records. On a normal name such as Mark it works
perfectly. Is there anywas i can treat the whole customer name as a string?
Does anyone have some advice?
Thanks,
Mark
I have a form that is based on a query, i use this form to group customers
together based on warranty claims they have made. One customer can have
several claims and some customers will have un resolved claims. It is
important for me to count these records based on two fields, customer name
and a certain status of their claim. This is what my code looks like so far
and it mainly works...
Let cn = [CustomerName]
intx = DCount("[StatusID]", "qryfrm", "[Customername] = '" & cn & "' AND
[statusid] = 2")
inty = DCount("[StatusID]", "qryfrm", "[CustomerName] = '" & cn & "' ")
[count1] = inty
My probem happens when a customes name has a ' in it such as Captain's
Marine. The ' seems to be seen as part of the code and i get a error message
when i try to count the records. On a normal name such as Mark it works
perfectly. Is there anywas i can treat the whole customer name as a string?
Does anyone have some advice?
Thanks,
Mark