473,473 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to prevent selecting duplicate records in a listbox.

I have a listbox where the user selects only one value at a time. The
problem is that once the user selects the value and the record is
updated in the table, they can reselect the same value again. I do
not want this to happen. Your input is greatly appreciated.
Nov 12 '05 #1
2 5775

Would it be possible to determine from the database if the record has been
updated already ? If so, it would be possible to use the AfterUpdate event.
In there you could change the recordsource of the list box so that the
record is excluded that has been changed already.

If not and you really want to do this, you could add a flag to the table. On
opening the form, all flags are cleared. On changing, the flag is set, and
the recordset is changed.
Alternatively, you could add a selection table that is emptied on opening
the form, and is filled with all the record ID's of the changed records (one
ID added after each record update). Change the list box recordset to SELECT
[x] FROM [y] WHERE [Id] NOT IN (Select [id] From [SelectionTable]).

Just play around a bit..

Bas Hartkamp.

** Computers can do ANYTHING It's just a matter of programmers' persistence
**
Fatou <fa*****@yahoo.com> schreef in berichtnieuws
a2**************************@posting.google.com...
I have a listbox where the user selects only one value at a time. The
problem is that once the user selects the value and the record is
updated in the table, they can reselect the same value again. I do
not want this to happen. Your input is greatly appreciated.

Nov 12 '05 #2
You will need some method to determine which records have been updated
(within the time limits you decide... perhaps "this execution of the
database") and select only those which have not been for your listbox.
Obviously, this will require a requery of the list box after you
update.

Perhaps an Updated field in the records, set when you update, and
cleared when you shut down the database application would do what you
want.

Larry Linson
Microsoft Access MVP

fa*****@yahoo.com (Fatou) wrote in message news:<a2**************************@posting.google. com>...
I have a listbox where the user selects only one value at a time. The
problem is that once the user selects the value and the record is
updated in the table, they can reselect the same value again. I do
not want this to happen. Your input is greatly appreciated.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Catherine Jo Morgan | last post by:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or...
1
by: Alvey Sidecast | last post by:
This is probably embarrassingly simple, but I've been trawling through this ng for hours now and my brain hurts. I've got an unbound multi-column listbox (multi-select=none) whose rowsource is a...
8
by: Ray | last post by:
I have a data input form and need to automatically duplicate the existing record as a new record by clicking a button. The main purpose to duplicate the record is that the new record is very...
11
by: ariel81 | last post by:
i have created a function to input data from four textboxes into a table. how do i prevent duplicate records of the same mth/Yr into the table? editing of the data in the table with reference to the...
4
by: mcca0081 | last post by:
hi - i'm trying to delete one of the duplicate records based on the most current date. here's the code for my access 2000 db. any help would be appreciated!!! - thank you kindly Sub...
1
by: jerrys57 | last post by:
I need some guidance on the listbox from a database...when I select the name from the listbox it displays fine in the textboxes...but if there is a duplicate name my search on the database gives me...
5
by: kwartz | last post by:
Can somebody please help me with a select statement for selecting duplicate records with one different field . I have 3 tables: A, B and C A has 2 fields I ---- primary key m B
4
by: jbrumbau | last post by:
Hello, I have been successfully using a database I've created for several months to populate an equipment list for a project we've been working on. However, the form has recently stopped working...
0
by: Walter Thizo | last post by:
I have substring the duplicate different records from file and i want to load those records inside listbox or paradox table distinctly - This is records from file : Student No 2001...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.