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

n00b help with serial values

Status
Not open for further replies.

graycom

IS-IT--Management
Dec 15, 2004
1
0
0
US
Somehow I volunteered to build a contact list and integrated production order database for my company...wise idea...

I've managed to build and integrate almost everything, from existing templates included with FMP 6, but have one problem.

In the contact database, I have two fields that I would like to work together. When someone enters a company name for a contact, I would like that company name if not yet entered into the database to recieve a customer number in the form of a 3 digit serial #, such as 001, 002, 003, and so on. But for instance if a contact is entered, and the company has already been entered for a previous contact, I would like that company's corresponding customer number to be automatically entered.

I've played with making a field use serial numbers, but as you can see, I don't need a new serial number for each new contact, only for new company field within the contacts.

Anyone?
 
You have to script the creation of the new customers.

Make a self relationship between the companies (Comp) based on companyID = companyID.
The customernumber will be generated by the scriptstep :
SetField (customernumber,Case(Comp::companyID>0,Right("000"&customernumber+1,3)))

With this you can concatanate the customer number with everything you want.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top