David McAfee
davidmcafee at gmail.com
Wed Nov 18 12:36:22 CST 2009
I think thats what this form is doing, entering the initial items into the system. I'd recommend using an autonumber PKID instead of using Item Name andItem Desc. Any table/form that needs to store the item in question should store the autonumber PKID. If the item description changes at a later date, you only have to change it in one place. On Wed, Nov 18, 2009 at 10:30 AM, Perry L Harold <pharold at proftesting.com> wrote: > > If you have set the Primary Key as ItemName+ItemDesc and attempt to > write the record it will give you an error message at that stage. > Assuming the data entry person can get it correct most of the time why > not capture the error at the point of writing the record and have > changes made at that point? > > Perry > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hollis, > Virginia > Sent: Wednesday, November 18, 2009 12:51 PM > 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 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >