Difference inbetween two codes

G

Guest

I have tried both the below code :

If DCount("*","TablName","[SerialNo] = " & Me.SerialNo) > 0 Then
Msgbox("Records were found")

It worked perfectly on one of the computer mdb.

While I tried to use the same code on another computer another mdb, it did
not worked, therefore I tried the below which worked :

If DCount("*","TablName",[SerialNo] = [Forms]![SSampleA]![SerialNo]) > 0 Then
Msgbox("Records were found")

As far as I know, both the purpose is same, both did the same job, therefore
below question is in my mind :

What is the difference inbetween both the above code?
Why it is working at one of the mdb and not working in another mdb?.

Please note that both the mdb is in MS Access 2000

Please advise me in details, so that it can be better for me in future while
I will work on this topic.

Regards.

Irshad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top