April 10, 200718 yr Newbies How do I prevent entry into a field if another field already has data in it? I'd also like to display an alert that says "You cannot enter field X because this record is being used for data types described in field Y. Please create a new record." Appreciate any help you can give! JT
April 10, 200718 yr Hi JT and welcome to the forums! If you don't want to be able to enter anything into field B if field A has something in it... Go to define database, go to options for field B, go to the validation tab, choose validation by calculation, then just type IsEmpty(FieldA) //if field A is empty, the calculation will return 1 which means you can edit field B, if field A isn't empty, it will return 0 or nothing which means you can't modify field B. Now the alert, hmmm, unfortuantly you can't use dynamic values like x and y but can enter some sort of other message in the display custom message if validation fails box: "Cannot enter a value in Field B because this record is already being used for the purpose described in field A"
April 10, 200718 yr Author Newbies Thanks so much! I've been screwing with this for what seems an eternity!
April 10, 200718 yr Glad i could help Actually... that validation message is kind of annyoing i've never really liked it.. another method would be writing the script below and then just attaching it to FieldB: If[isEmpty(FieldA)] Go To Field[FieldB] Else Show Custom Dialog["You cannot enter field X because this record is being used for data types described in field Y: " & FieldY & ". Please create a new record."] End if
Create an account or sign in to comment