Correct Syntax

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

Is this correct in refering to a table in an external database?
Thanks
DS

Me.TxtVoids = Nz(DCount("VoidID",
"\\Backoffice\Warehouse\History.mdb\tblVoids","VoidID>1")
 
I doubt that would work.

Perhaps you could use a query such as this:

SELECT Count("*") AS HowMany
FROM tblVoids IN "\\Backoffice\Warehouse\History.mdb"
WHERE VoidID > 1;
 
Allen said:
I doubt that would work.

Perhaps you could use a query such as this:

SELECT Count("*") AS HowMany
FROM tblVoids IN "\\Backoffice\Warehouse\History.mdb"
WHERE VoidID > 1;
Thanks Allen, but the problem is I need to drop it into a textbox.
And you can't use select to populate a textbox.

DS
 
I tried using a Query. The Query works as a Query but when I put it on
a form to populate the textbox it doesn't work.

The Query... This works

"SELECT Count(tblVoids.VoidID) AS CountOfVoidID " & _
"FROM tblVoids IN '\\Backoffice\Warehouse\History.mdb';"


The Function... This Doesn't

TextV = Nz(DCount("VoidID","QueryVoids"),0)

DS
 
The query returns one field named CountOfVoidID, so try:

=DLookup("CountOfVoidID", "QueryVoids")
 
Allen said:
The query returns one field named CountOfVoidID, so try:

=DLookup("CountOfVoidID", "QueryVoids")
Thanks Allen, I ended up making the Query without the count then it
worked fine. Your suggestion also worked.
Once again Thank You.
DS
 
Back
Top