How to look for duplicate (1 Viewer)

cecil24tn

New member
Local time
Today, 12:56
Joined
Dec 17, 2020
Messages
14
I agree. But the funny thing about your form/table is you are asking for a value in that field. For example, open the New InHouse Ticket form and then enter something in the Transaction# Textbox. But, instead of hitting the Enter key, highlight what you just entered and hit the Delete key, then hit the Enter key. You will get an error message.

So, if we try to "clear" the duplicate number, we are "forced" to replace it with something else. Your Table settings doesn't allow to just clear that one field.

At least, that's what I think is happening.
Ok in the table I have the Field Properties "Required" set to Yes. Is this the best way to handle this?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:56
Joined
Oct 29, 2018
Messages
21,467
Ok in the table I have the Field Properties "Required" set to Yes. Is this the best way to handle this?
You will have to decide. Sometimes, there's a trade off. You'll have to go with what you feel comfortable.

Like I said earlier, if you want the field required, you can leave that settings in, but the code will have to be adjusted to accommodate. If you take the required settings out, you can then change the code to assign a Null value to the control. Then, you could just use a validation code in the Form's BeforeUpdate event, so you can tell the user to fill in any "required" input before saving and closing the form.
 

isladogs

MVP / VIP
Local time
Today, 17:56
Joined
Jan 14, 2017
Messages
18,213
Have you tried the Find duplicates query that is supplied with Access?
Create ribbon...Query wizard...Find Duplicates query wizard.
It makes the process very easy.
 

cecil24tn

New member
Local time
Today, 12:56
Joined
Dec 17, 2020
Messages
14
You will have to decide. Sometimes, there's a trade off. You'll have to go with what you feel comfortable.

Like I said earlier, if you want the field required, you can leave that settings in, but the code will have to be adjusted to accommodate. If you take the required settings out, you can then change the code to assign a Null value to the control. Then, you could just use a validation code in the Form's BeforeUpdate event, so you can tell the user to fill in any "required" input before saving and closing the form.
Let's set it to no and do the code that way. When we are done I would like for you to explain all of the code to me to help me learn this better. Again Thanks
 

cecil24tn

New member
Local time
Today, 12:56
Joined
Dec 17, 2020
Messages
14
Have you tried the Find duplicates query that is supplied with Access?
Create ribbon...Query wizard...Find Duplicates query wizard.
It makes the process very easy.
No i have not. But I will look at it. I like what he is doing with this code now I want to learn it. Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:56
Joined
Oct 29, 2018
Messages
21,467
Let's set it to no and do the code that way. When we are done I would like for you to explain all of the code to me to help me learn this better. Again Thanks
Okay, this is not complete yet, but I have to leave the office now.
 

Attachments

  • Test(5).zip
    49.8 KB · Views: 100

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:56
Joined
May 7, 2009
Messages
19,230
i made some changes to your uploaded db.
 

Attachments

  • Test (1).accdb
    1.3 MB · Views: 100

Users who are viewing this thread

Top Bottom