Jump to content

A metric imperial two field question


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

Recommended Posts

If you set up both fields as number fields, and define each of them (via the field definition options dialog) to auto-enter a value by calculation, specifying the calculation as the other field multiplied by the appropriate conversion factor, you will achieve what you want.

With this arrangement, a value will be able to be entered into either field (metric or imperial) and when it is, the corresponding (converted) value will automatically appear in the other field.

Link to comment
Share on other sites

Two problems with that, at least in v5.5:

1) Auto-enter calc's only fire when the field is empty... it won't reset a field with a value

2) FMP won't let you do what you said... it will complain of a circular definition

Did you mean to auto-enter by lookup? That gets past problems 1 & 2... but I tried it, and can't seem to get the lookups to fire. I tried making the match field depend upon the two fields, but that didn't seem to get it moving.

Link to comment
Share on other sites

Yes. I'm afraid I omitted to mention that for one or both of the Auto Enter calculation formulae, you will need to specify the field using the GetField( ) function - that bypasses the circular definition error and forces the auto-enter to work in both directions.

As Brian says, the auto-entry is a one-shot, and if you edit one of the values the other one won't update (unless you clear it first).

In some situations this may not be a problem. If it is, then I suggest you turn the 'Allow entry into field' option off for both fields, and attach a script to each of them which clears the other field first then places the cursor into the field for editing.

I've attached an example file which shows both methods in action, and includes examples of the scripts you'd need to use for the latter method.

One compromise with this latter solution is that neither of the fields will be included in the tab order. If this is an issue then thre are a few other alternatives you might consider involving calculating fields, but have a look at the attached example first and see if there is something there you can use.

Conversion.zip

Link to comment
Share on other sites

This topic is 7830 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.