I'm trying to do the following:
As the user edits data they will be selecting from a dropdown box with 3 values 1, 2 or 3. The next selection depends on that selection:
If the user selected 1 in the first combobox then they can not make a selection in the second dropdown, if the user selects either 2 or 3 in the first dropdown then they have to have a selection with a value (not "Please Select") in the second dropdown. The first drop down is filled by a list of values while the second dropdown is filled from a lookup table.
My question is how to do this.
Do I handle this in the beforeedit code section?
If so how would I write this code?
How do I verify that the selection in the second combo box has a value if either 2 or 3 is selected in the first combo?
Should the dependencies be handled on the lookup table screen?
This is the code that I have in the beforeedit event on the edit page but it just updates the information each time. It's like it's not validating the if statements. That's why I don't think I have them written correctly:
If dict("HardwareScenarioTypeID") <> "1" and IsNull(dict("DefaultHardwareID")) then
Response.write "You must select a default hardware."
BeforeEdit = False
else if dict("HardwareScenarioTypeID") = "1" and not ISNull(dict("DefaultHardwareID")) then
Response.write "You have selected a default hardware for an item you designated as having no hardware. Please check to make sure that this item needs a default hardware selection."
BeforeEdit = true
Else
BeforeEdit = True
End if
End if
Thanks for any help!