Jump to content

creating records


Matt
 Share

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

Recommended Posts

quote:

Originally posted by Matt:

Is this possible in FM 4.1 to write a script that will create 100 records with field values from "1" to "10" and "A" to "J".

i.e. to have 100 records that are labelled 1A, 2A, 3A
Link to comment
Share on other sites

It's actually pretty simple.

Define two fields:

Serial No. (number, autoenter, 1 by 1)

Special Serial No.(calculation, text) = Case(Mod(Serial No., 10) = 0, 10, Mod(Serial No., 10)) & Case(Int(Serial No./10) = 0, "A", Middle("ABCDEFGHIJ", Int((Serial No.-1)/10) + 1, 1))

-bd

[This message has been edited by LiveOak (edited September 20, 2000).]

Link to comment
Share on other sites

  • Newbies

Thanks for that it works fine,

but I can't work out a way to reset the serial No. field so I can create subsequent sets of 100 records (I would like to identify each set with three other pieces of user inputed info).

Will I have to make the serial No. field a value list?

Is it possible?

Thanks again

Link to comment
Share on other sites

Ah, ha! So that wasn't the EXACT question, how to do this for 100 records! I am prone to answer the question you asked, not the one you should have asked! wink.gif.

Extra Special Serial Number (calc, text) =

Case(Mod(Mod(Serial No., 100), 10) = 0, 10, Mod(Mod(Serial No., 100), 10)) & Case(Mod(Serial No.,100) = 0, "J", Int(Mod(Serial No., 100)/10) = 0, "A", Middle("ABCDEFGHIJ", Int((Mod(Serial No., 100)-1)/10) + 1, 1))

-bd

[This message has been edited by LiveOak (edited September 25, 2000).]

[This message has been edited by LiveOak (edited September 25, 2000).]

Link to comment
Share on other sites

This topic is 7695 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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