CharlieT302
Instructor
Hi All,
I am having a syntax problem. I am trying to prevent a duplicate record from being entered into a subform.
Each of the two expressions below work fine independently.
If Dcount("[Home_Qty]","tbl_Orders",Item=Dlookup("[Item_Id]","Menu"))>0 then
Msgbox
If Dcount("[Home_Qty]","tbl_Orders","Entry_date=#" & Parent!Entry_date &"#" & "and Site_ID=' " & Parent!site_ID & " ' ")>0 then
Msgbox
However, I when I combine the three criteria (below)into a single expression, it evaluates as false, even though it shouldn't.
If Dcount("[Home_Qty]","tbl_Orders",Item=Dlookup("[Item_Id]","Menu")," and Entry_date=#" & Parent!Entry_date &"#" & "and Site_ID= ' " & Parent!site_ID & " ' "))>0
Msgbox
What would be the correct syntax to combine these?
Background Info:
Item & Item_ID fields are numeric
Thanks much
I am having a syntax problem. I am trying to prevent a duplicate record from being entered into a subform.
Each of the two expressions below work fine independently.
If Dcount("[Home_Qty]","tbl_Orders",Item=Dlookup("[Item_Id]","Menu"))>0 then
Msgbox
If Dcount("[Home_Qty]","tbl_Orders","Entry_date=#" & Parent!Entry_date &"#" & "and Site_ID=' " & Parent!site_ID & " ' ")>0 then
Msgbox
However, I when I combine the three criteria (below)into a single expression, it evaluates as false, even though it shouldn't.
If Dcount("[Home_Qty]","tbl_Orders",Item=Dlookup("[Item_Id]","Menu")," and Entry_date=#" & Parent!Entry_date &"#" & "and Site_ID= ' " & Parent!site_ID & " ' "))>0
Msgbox
What would be the correct syntax to combine these?
Background Info:
Item & Item_ID fields are numeric
Thanks much