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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIQUE VALUE

Status
Not open for further replies.

rsamson

Programmer
Feb 22, 2002
4
US
I am trying to right a formula that will force a field value to be unique if another field is equal to 'yes'

example: if field1=yes, than field2 must be unique, else field2 can be any value.

Any help would be appreciated.

 
Simple method:

1) Go to Create, Join and select the database that contains field2. Click the "Alias" button and join the alias of the db to the original db using field2 in each db. If your db is named "Table", then you will have a Table:1 and a Table:2 to work with.

2) On the form where field1 is displayed, add a macro "on data change" of field1. The macro would be simple:

Check Field2
RUN If(Table:1.field1 = 'Yes' and IsBlank(Table:2.field2) then end this macro, else continue this macro
RUN If(Table:1.field1 = 'Yes' then continue this macro, else end this macro
MESSAGE "Field2 is not unique", etc...
SET Table1:field2 = '' (this would clear the field)
TAB to wherever you wish...

Sue Sloan
 
thank you. do you know of a good book that I can get to show me some of the more advanced techniques?
 
I wrote a book a while back. It does not cover anything about LotusScript, but it does cover a lot of Approach techniques. It is 660 pages and you can find it on XpertSS.com in the XpertSS Store.

Sue Sloan
XpertSS.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top