[AccessD] Duplicates on Two Values

Rocky Smolin rockysmolin at bchacc.com
Wed Nov 18 12:50:35 CST 2009


Needs a space between the ' and the AND in ...& "'and "ItemDesc... 

And no " before ItemDesc

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hollis, Virginia
Sent: Wednesday, November 18, 2009 9:51 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Duplicates on Two Values

This gives me an error. I think because I have the text fields ''''
messed up.

 

  If Not IsNull(ItemName) And Not IsNull(ItemDesc) Then

    If DCount("ItemName", "tbl_ItemMain", "ItemName = '" & [ItemName] &
"'and "ItemDesc = '" & [ItemDesc]) > 0 Then

        MsgBox "You have entered a ItemName and ItemDesc that already
exists"

        ItemName.SetFocus

        ItemName.Undo

    End If

End If

 

 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list