Jump to content

Two unique fields - Data entry alert


This topic is 7315 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I found a way to enter First and Surname into two fields and have FMP check them for both being unique in real time. The solution involves the Status(CurrentFieldName) command. This can be used to perform a calculatopn ONLY if you are currently in a specified field.

Your file has the following fields:

First

Surname

Address

You will also need to create the following calculation:

FullName (Calculation, Text result) = Name & Surname

Next create a self-join relationship based on FullName. This is a relationship in which the master file and related file are the same database file.

To create a self-join:

1. In the current file, choose File menu > Define Relationships. Or, choose Define Relationships from the relationship list.

2. In the Define Relationships dialog box, click New.

3. In the dialog box that appears, double-click the name of the current file.

4. In the Edit Relationship dialog box, for Relationship Name, type a unique name for the relationship, for example

Link to comment
Share on other sites

That's really neat!

Suggested modification -

Case((Status(CurrentFieldName) <> "First") and

(Status(CurrentFieldName) <> "Surname"),

Case(FullName=SelfJoin::FullName,"Warning Duplicate Name",""),"")

This caters for files with more than three fields.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.