T
tsuby
Hi everybody,
as a change I am stuck with some code and I cannot make a Dcount
function work.
I have my Table with Customers (Tbl_Customers)
CustomerID. (text)
Name
Company
etc.
Then I have another Table with Orders by these Customers (Tbl_Orders)
CustomerID (Text)
OrderID (Text)
Cdxdix (text) which is some other data I have to insert about each
order. Many customers can have the same cdxdix.value, but only once.
etc.
Now whenever I enter data regarding one order, I need to make sure of
this and I thought of using a Dcount function, but I can't find a way
to do it right:
If DCount("*", "Tbl_Orders", "CustomerID='" & Me!CustomerID& "'" AND
"Cdxdix", "CustomerID", "Cdxdix='" & Me!Cdxdix & "'") > 1 Then
etc.
But I keep getting a "wrong number of arguments" error.
What am I doing wrong? Is Dcount the word way to go?
Thanks in advance for the help!
Erika
as a change I am stuck with some code and I cannot make a Dcount
function work.
I have my Table with Customers (Tbl_Customers)
CustomerID. (text)
Name
Company
etc.
Then I have another Table with Orders by these Customers (Tbl_Orders)
CustomerID (Text)
OrderID (Text)
Cdxdix (text) which is some other data I have to insert about each
order. Many customers can have the same cdxdix.value, but only once.
etc.
Now whenever I enter data regarding one order, I need to make sure of
this and I thought of using a Dcount function, but I can't find a way
to do it right:
If DCount("*", "Tbl_Orders", "CustomerID='" & Me!CustomerID& "'" AND
"Cdxdix", "CustomerID", "Cdxdix='" & Me!Cdxdix & "'") > 1 Then
etc.
But I keep getting a "wrong number of arguments" error.
What am I doing wrong? Is Dcount the word way to go?
Thanks in advance for the help!
Erika