Newbies teij Posted April 10, 2007 Newbies Posted April 10, 2007 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
Genx Posted April 10, 2007 Posted April 10, 2007 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"
Newbies teij Posted April 10, 2007 Author Newbies Posted April 10, 2007 Thanks so much! I've been screwing with this for what seems an eternity!
Genx Posted April 10, 2007 Posted April 10, 2007 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
Recommended Posts
This topic is 6439 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now