View Full Version : Limit user to select from 1 of 2 combos per record


disneyplace
03-04-2002, 06:55 AM
I have 2 combos on a subform (cmbPurchase & cmbFactory). I only want a user to make a selection from one of the 2 combos. So if a choice is made from one combo, lock the other or vice versa? There should be a message displayed which resets the combos when the message is acknowleged, but only if the user tries to create a new record?

chrismcbride
03-04-2002, 08:28 AM
IN the BeforeUpdate of each Combo, test for the value of the other using > 0 or IsNull (depending on the data type of the combo's bound column). If the other combo already contains a value, use the cancel property of the Before update event to stop the transaction and Me.cboWhatever.Undo to reverse the values added.
HTH
Chris

disneyplace
03-04-2002, 08:51 AM
Thanks for that. It works a treat!

TAC