mamradzelvy
Member
- Local time
- Today, 18:18
- Joined
- Apr 14, 2020
- Messages
- 145
Hello, i'm rather new to access and as my first project i've started working on an inventory type db which is using barcodes as primary key, however as our office is a hot mess, it happens on the regular, that while adding items to it, we encounter duplicates and since i have the collumn for the barcode id set up to forbid duplicates, its throws out an error.
My question is: would it be possible in access to recognize the attempt to input a duplicate value and instead take only the value of "amount" and add it to the existant records current amount? Let's say i have an item with the barcode 12345, for instance a hdmi cable. now in my inventory db the item 12345 already has got an entry with 20 pieces in stock and i just filled out a input form with some 5 more pieces, i would like to scrap the current forms values such as name and type and other properties i have preset and only keep the value and add it to the existing record to make it say 15, but only in case that the selected inventory type on the current form (in this case "cable") matches the already existing records value "cable")
I have been trying to find a way to make this happen, however i've been unable to, as my knowledge of vba and access in general is quite limited at the moment. i would greatly appreciate any input on this, thank you!
edit: i apologize for any grammar mistakes, im Czech.
My question is: would it be possible in access to recognize the attempt to input a duplicate value and instead take only the value of "amount" and add it to the existant records current amount? Let's say i have an item with the barcode 12345, for instance a hdmi cable. now in my inventory db the item 12345 already has got an entry with 20 pieces in stock and i just filled out a input form with some 5 more pieces, i would like to scrap the current forms values such as name and type and other properties i have preset and only keep the value and add it to the existing record to make it say 15, but only in case that the selected inventory type on the current form (in this case "cable") matches the already existing records value "cable")
I have been trying to find a way to make this happen, however i've been unable to, as my knowledge of vba and access in general is quite limited at the moment. i would greatly appreciate any input on this, thank you!
edit: i apologize for any grammar mistakes, im Czech.