First of all thanks for all your help so far. I am struggling with some basic things that I used to do in Excel VBA. I want to be able to validate information by searching for a duplicate entry. So to give you an example of what I have setup is: I have a projectdetailID, ProjectID, ItemID. I adding components to a project using ProjectDetailsID. What I don't want is the user to add the same ItemID twice. So I need an error when I have the user attempt to duplicate the same ItemID twice. Example first entry is ProjectDetailsID = 1, PrjoectID = 1, ItemID = 35 second entry is ProjectDetailsID = 1, ProjectID = 1, ItemID = 36 Third entry is ProjectDetailsID = 1, ProjectID = 1, and then user duplicates by selecting ItemID = 35 again. The way I used to do this was search and if the search came back true then I would do an If statement that would error if it was duplicated. I just am lost on how I would do it now. I am using a query so I assume I would need to search qry for that field an if it duplicates it msgbox an error. Any help would be appreciated. I have decided that I need to take a VBA class or something. I was able to get by in Excel VBA, but everything in access has been more advanced them I am used to.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Microsoft Access 307.