Solved where is the error in the code (1 Viewer)

theinviter

Registered User.
Local time
Today, 11:06
Joined
Aug 14, 2014
Messages
240
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
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:06
Joined
Feb 28, 2001
Messages
27,192
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 (!).
 

cheekybuddha

AWF VIP
Local time
Today, 19:06
Joined
Jul 21, 2014
Messages
2,280
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] & "'")
 

theinviter

Registered User.
Local time
Today, 11:06
Joined
Aug 14, 2014
Messages
240
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
 

theinviter

Registered User.
Local time
Today, 11:06
Joined
Aug 14, 2014
Messages
240
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
 

jdraw

Super Moderator
Staff member
Local time
Today, 14:06
Joined
Jan 23, 2006
Messages
15,379
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

Top Bottom