Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

The last time I was here, I had another problem with auto-generating a field, and you all were very helpful, and that database has worked like a charm for over a year, so THANK YOU! Now I am building a new db, and have another problem:

I am building a photo catalog, where I want FM to generate my filenames for me. I have set up radio buttons to select either "LK" or "OMI" using a value list. What I would like is to be able to check either one, and if the button for LK is selected, I want "27_" to show up before an autogenerated serial number (so the file name would be 27_0001), and if OMI is selected, have "53_" show up before the serial number.

I tried just changing the value in the value list to 27_ and 53_ (because I can get that to show up in the field) and then putting a white box over the 27_ and 53_ and typing on what I want on top of the box, but when I go into browse mode, the box comes to top, so it shows 27_ and 53_, and not the LK and OMI that I want the person doing data entry to see.

This is what I have in the caluculation field now:

Filename=

Company &

Right("0000" & serial , 4 )

I think it should be something along the lines of "If Company = LK then insert "27_" ; if Company = OMI then insert "53_" &

Right("0000" & serial , 4 )

but I don't know how to make that work. I don't care if I have to switch to a drop down menu, or change other things, my concern is that data entry person selects either LK or OMI and the correct prefix for the filename shows up.

Thanks for your help!

Posted (edited)

Your serials should remain unaltered. And, as you've discovered, you can create a calculation which displays the concatenated value for your User. You had the idea with:

"If Company = LK then insert "27_" ; if Company = OMI then insert "53_" &

Right("0000" & serial , 4 )

Try this (calculation result is text):

Case ( Company = "LK" ; "27_" ; Company = "OMI" ; "53_" )

&

[color:blue]Right ( "0000" & serial ; 4 )

:smile2:

But you can also replace the portion in blue with:

SerialIncrement ( "0000" ; serial )

... which is designed for this purpose.

Edited by Guest
Added alternate calc

This topic is 5516 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
×
×
  • Create New...

Important Information

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