Also if the criteria that user enter is not finding in the db, I would like clean the crieria and let use try it again. Currently I use reopen the search form and I don't know if there's better way to do it.

Re: DCount (2000)

First of all, I'd get in the habit of giving your controls names that include a controlprefix. So instead of a control with the name of Name, I'd make it txtName. This will avoid confusion later on, expecially when you are using controlnames that are the same as property names.

Secondly, I'm not sure Dlookup can evaluate the forms references within the quotes like that. To be safe, you might want to do it this way. Notice that I used chr(34) to embed the result of the Name reference surrounded by double-quotes. I'm assuming PO is numeric?

Re: DCount (2000)

Thanks, and it works.

But I got another problem. In client information table have first name & last name. I combine the first name & last name as Full Name in one query and I do DCount on this query. As I try to search the full name, DCount reply not find but actually the name is there. So if I DCount only first name or last name, data is find. If I DCount Full Name, db doesn't pick any data. Below is the code that I put the query to combine the first name & last name.

Re: DCount (2000)

You should be able to do it that way. Are you sure that Name is the name of the text box in which you enter the full name to search for?
What happens if you temporarily remove the part that refers to PO:

Re: DCount (2000)

Hi Hans,

Yes I am sure that the Name is the name of the text box in which I enter the full name to search. It have same problem even I remove the PO.

Please review the attached test file will help you know my problem. For example, if you enter test in the name box then click search. DB will tell you there's no criteria find but you can see there's a person name call test. If you remove the DCount code from Search button, you are able to search.

Re: DCount (2000)

You are now looking for the full name. There is a person whose full name is Test Test. If you enter that in the Name box, the person will be found. If you enter Test, DCount will report that the name was not found since the DCount function uses = so it tests for an exact match.
In fact, you do not need to specify a Where-condition in DCount, since the query qryCDNoAsc already contains the required criteria based on the text boxes on the form. You can simply use
<code>
If DCount("*", "qryCDNoAsc") = 0 Then
</code>
Try it, I think you'll find it does exactly what you want, even if you enter only part of a full name.