473,434 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Enforcing no duplicates in multiple textbox controls

I have a form w/ 11 identical text boxes in each of which user can
enter a number between 1 and 11. Each defaults to 0, which I use to
flag empty. Each has the 1 to 11 restriction as its validation rule,
but I also need to enforce no duplicates among them. I haven't been
able to figure out how to do this in the validation rule, so I have a
function that gets as a parameter a number to identify which textbox
is calling it that handles that for me. But that means that I have 11
lostfocus events in 11 separate subroutines that do nothing but call
the same function with their own identifying numbers. Is there a less
clumsy way to do this?
thanks, --thelma

Nov 30 '05 #1
1 1698
Yes, the less clumsy way would be to create a related table.
You can then select any number of rows in that table, related to the one in
your original table, and easily ensure no duplicate.

For example, if these 11 are colors, and you don't allow Blue to be picked
twice for the same client, the related table would have fields:
ClientID which client
ColorID which color
You select both fields together, and make them primary key in this related
table. Problem solved.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Thelma Lubkin" <th****@alpha2.csd.uwm.edu> wrote in message
news:dm**********@uwm.edu...
I have a form w/ 11 identical text boxes in each of which user can
enter a number between 1 and 11. Each defaults to 0, which I use to
flag empty. Each has the 1 to 11 restriction as its validation rule,
but I also need to enforce no duplicates among them. I haven't been
able to figure out how to do this in the validation rule, so I have a
function that gets as a parameter a number to identify which textbox
is calling it that handles that for me. But that means that I have 11
lostfocus events in 11 separate subroutines that do nothing but call
the same function with their own identifying numbers. Is there a less
clumsy way to do this?
thanks, --thelma

Nov 30 '05 #2

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

Similar topics

1
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. ...
9
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say...
3
by: dpomt | last post by:
I am facing some issues with the webforms DefaultButton functionality: #1 One text box ==> hitting enter works in IE but not in Firefox (1.5) #2 One text box and req. field validator ==> problem...
2
by: Darren Carter | last post by:
Hi, I have mutliple asp:Panel controls on a single page, each with a default button defined (each default button resides within its respective asp:Panel). All validation controls and buttons...
1
by: Dave A | last post by:
I have a problem that I have boiled down to a very simple example. I have a user control that displays a some data from a business object. On one screen I have a collection of these business...
8
by: hunanwarrior | last post by:
I added textbox controls to a form when user selects amount to create from a combobox as follows: 'Load up the combobox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As...
4
by: yin_n_yang74 | last post by:
I am new to SQL and SQL Server world. There must be a simple solution to this, but I'm not seeing it. I am trying to create a crystal report (v8.5) using a stored procedure from SQL Server...
3
by: MikeB | last post by:
Hello, I have a content page that is from a Master page which has 2 content panes. How do I add my forms to the content page? Each pane needs a form but you can not have multiple form tags nor...
2
by: englishman69 | last post by:
Hello, I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...

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.