Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FM 5.5-Prevent No Dupes in 2 Fields

Status
Not open for further replies.

tallbarb

Instructor
Mar 19, 2002
90
US
I am a new FM user. What I want to do is prevent duplicates in two fields in a registration table. The two fields are: PhaseNo and ProjectNo. What I don't want to have happen is the same ProjectNo along with its corresponding PhaseNo to be duplicated for any record. Currently, there is nothing to prevent someone from entering creating a new record but with those 2 fields containing values stored in another existing record. The two fields are indexed and set as text types. HELP......and remember, I'm a newby. Thank you!
 
In fefine fields, options, validation, check unique for your field...

HTH

JW
 

Duplicate Check - Calculations that show how to warn a user during data entry that a duplicate or empty record has been entered.
Duplicate Records - A file that shows you how to take care of duplicate records in your database

All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
I'm still not sure I have explained this correctly. Here's an example:

Project Number Phase Number Duplicate?
END001 01 NO
END002 01 NO
END001 02 NO
END002 02 NO
END001 01 YES

In other words - I can have duplicates in EITHER the Project Number or the Phase Number but not both at the same time. Our phase numbers go from 01 through 99 and another phase number starts using 01 through 99 for its Phase Numbers - and so on and so on. So, I don't want the Project Number to be unique - I will have 99 records that use the same one. I don't want the Phase Number to be unique, I will have more than one "01" but in different Projects. But, I should never have END001 and 01 together more than once. I looked at the example and it only checks ONE field - I need them both validated as unique as a group. Thanks again!!!!
 
Hi tallbarb!
here is the solution that will prevent your from entering/creating that scenario:

Duplicate Data Entry Validation Using Multiple Fields

U can also use the same concept just to "scope out and flag" these duplicates vs. "prevent it from being entered"
here is a quikc/temp sample:

All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Will duplicating a record be possible if the first suggestion is used where it prevents entry of duplicates rather than warns? In our current situation, we use an existing record to create a new record of the same type (in a registration database where we set up classes - same class, different day, different phase number) - we typically only have to change the phase number (the project is usually the same for the first 99 records). Thanks again!
 
yes and no....
the record will be created BUT user will be "warn" "oin field exit " and NOT be able to continue entry NOT EXIT the file UNTIL they either "edit/correct" the entry or DELTE it.
so in your sample....as soon as you enter the phase number they will get the Validation message...
Give that link a try and if you still have problems post some more!
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
:) sorry...spelling issue
you should be OK to D/L
let me know if it all works out...
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
I can feel the answer getting close. I am missing something though - what is the "Self_Related_Compound::c_CurrectRecID" in the field options for the Flag Duplicates field??? I created all the fields (except the phase and project) just as you had them - copied and pasted exactly what you had - and I get an error - Unknown Field and FM highlights the Self_Related_Compound::c_CurrectRecID text. I don't know what that is although I suspect it has something to do with relationships - but, like I said, I am new to FMP. Please advise.......and thank you, again!
 
Never mind - I figured it out. THANK YOU!!!! It's working - YES!!!
 
excellent!
[thumbsup2]

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top