How do i stop the user entering the same value in two combo boxes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I stop the user entering the same value in two different combo boxes
if the combo boxes contain the same data but their sources are in two
different columns?

I’m new to access so sorry if this doesn’t make much sense. I’ll explain my
problem further:
I am trying to create a fantasy football database, I have two columns
striker 1 and striker 2, and they contain the same list of player’s names. In
my form I have two combo boxes one for each column i.e. striker. How do I
prevent the user from selecting the same striker in both combo boxes?

Any help on this or anything with regards to a fantasy football database
would be greatly appreciated.

Thanks Monkey Man
 
use the validation field in the properties. For the second combo box put
something like...

Not [FirstComboBoxName]


Rick B
 
One approach would be to catch when the same value's been selected (see Rick
B.'s response).

Another approach would be to eliminate the first choice from the second list
of possibilities. This may prove to be more user-friendly, since there is
no way they could accidentally or deliberately choose the same person.

To do this, modify your row source of the second combo box to include a
criterion of:

Not Forms!YourForm!YourFirstComboBox
 
this works but i added and extra combo box and an extra striker so thats 3
different combos , it works when there is player already selected but when a
new user is added and they want to select their team the combo boxes are
empty and thus wont allow you to enter a player beacause the other two combos
are empty.

Rick B said:
use the validation field in the properties. For the second combo box put
something like...

Not [FirstComboBoxName]


Rick B


Monkey Man said:
How do I stop the user entering the same value in two different combo boxes
if the combo boxes contain the same data but their sources are in two
different columns?

I'm new to access so sorry if this doesn't make much sense. I'll explain my
problem further:
I am trying to create a fantasy football database, I have two columns
striker 1 and striker 2, and they contain the same list of player's names. In
my form I have two combo boxes one for each column i.e. striker. How do I
prevent the user from selecting the same striker in both combo boxes?

Any help on this or anything with regards to a fantasy football database
would be greatly appreciated.

Thanks Monkey Man
 
same problem with this approach...when a new user is added to the database
and wants to add their team the combo boxes are empty
 
I don't recall that as part of the original post. It sounds like you could
look into using the NotInList event to add a new team.
 
Back
Top