Difference inbetween two codes

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top