Finding duplicates based on a bound text box entry (1 Viewer)

Mahall906

New member
Local time
Today, 23:05
Joined
Apr 11, 2014
Messages
29
Hi folks, looking for help on what may be a simple matter......

I have a text box called "Serial" that is bound to a table called "Enforcement1". I would like to place a list box, or similar, next to the "Serial" box on the form, that will show any duplicates it finds in the "Enforcement1" table, when an entry is placed in the "Serial" text box.

I have searched on the web and found a number of tips but I'm struggling to find one suitable. Most are based on a search box, however I need the Serial number to remain as a record when entered.

Any help, as always, is greatly appreciated.

M
 

jdraw

Super Moderator
Staff member
Local time
Today, 19:05
Joined
Jan 23, 2006
Messages
15,364
What is the underlying issue? Do you really want duplicates? Or do you want to remove duplicates?
 

Mahall906

New member
Local time
Today, 23:05
Joined
Apr 11, 2014
Messages
29
What is the underlying issue? Do you really want duplicates? Or do you want to remove duplicates?
I'd like it to show the duplicates, so I can see if I have dealt with it before.
 

jdraw

Super Moderator
Staff member
Local time
Today, 19:05
Joined
Jan 23, 2006
Messages
15,364
Can you show us the design of Enforcement1?
And a few sample records highlighting duplicate serial.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:05
Joined
Feb 19, 2002
Messages
42,976
The listbox needs to be unbound and its RowSource query references the Serial field on the form.

Select ... From ... Where Serial = Forms!yourform!Serial

Then in the AfterUpdate event of the Serial textbox, requery the listbox

Me.lstSerial
 

Mahall906

New member
Local time
Today, 23:05
Joined
Apr 11, 2014
Messages
29
Apologies, I haven't replied recently! I have managed to refine my database opening search page and reduced the codes etc to produce a couple of list boxes in my form. Works a treat. I must add this original search page was done with the help of forums so thanks ;-)
 

Users who are viewing this thread

Top Bottom