Solved where is the error in the code

theinviter

Registered User.
Local time
Yesterday, 18:43
Joined
Aug 14, 2014
Messages
268
Dears;

can you help me to correct the blew code , i got error message, as i want to count the numbe row in 8-Expiry_List table with similar LinkID.


Expr1: DLookUp("CountofLink_ID","Find duplicates for [8-Expiry_List]","[location code] = " & [8-Expiry_List]![location code] & " And [item_code] ='" & [8-Expiry_List]![Item_code] & "'")

thnaks
 
It would strongly help to know WHICH error message you got. I'll say right now that having special characters like [] in a domain name (2nd DLookup argument) is highly questionable.

However, the only place that looks suspicious syntactically is your criteria clause. It will also help to see the SQL for which Expr1 is actually in use. I suspect that you have confused the DLookup with a fully qualified field spec of [8-Expiry_List]!... - because if this query is NOT on table 8-Expiry_List then that reference is unresolvable, and it if IS on table 8-Expiry_List, the reference shouldn't need to use bang (!).
 
Code:
Expr1: DLookUp("CountofLink_ID","Find duplicates for [8-Expiry_List]","[location code] = " & [8-Expiry_List]![location code] & " And [item_code] ='" & [8-Expiry_List]![Item_code] & "'")
Looks like the problem is with the table name defined in your DLookup():
Code:
Expr1: DLookUp("CountofLink_ID","Find duplicates for [8-Expiry_List]","[location code] = " & [8-Expiry_List]![location code] & " And [item_code] ='" & [8-Expiry_List]![Item_code] & "'")
                                 ^^^^^^^^^^^^^^^^^^^^
                                 ||||||||||||||||||||
Probably all you need is:
Code:
Expr1: DLookUp("CountofLink_ID","[8-Expiry_List]","[location code] = " & [location code] & " And item_code ='" & [Item_code] & "'")
 
It would strongly help to know WHICH error message you got. I'll say right now that having special characters like [] in a domain name (2nd DLookup argument) is highly questionable.

However, the only place that looks suspicious syntactically is your criteria clause. It will also help to see the SQL for which Expr1 is actually in use. I suspect that you have confused the DLookup with a fully qualified field spec of [8-Expiry_List]!... - because if this query is NOT on table 8-Expiry_List then that reference is unresolvable, and it if IS on table 8-Expiry_List, the reference shouldn't need to use bang (!).
thanks solved, appreciate your help
 
Looks like the problem is with the table name defined in your DLookup():
Code:
Expr1: DLookUp("CountofLink_ID","Find duplicates for [8-Expiry_List]","[location code] = " & [8-Expiry_List]![location code] & " And [item_code] ='" & [8-Expiry_List]![Item_code] & "'")
                                 ^^^^^^^^^^^^^^^^^^^^
                                 ||||||||||||||||||||
Probably all you need is:
Code:
Expr1: DLookUp("CountofLink_ID","[8-Expiry_List]","[location code] = " & [location code] & " And item_code ='" & [Item_code] & "'")
thanks solved, appreciate your help
 
Do you want to describe the solution? It may just help someone in future --after all that is a goal of the forum.
 

Users who are viewing this thread

Back
Top Bottom