Jump to content

Allowing duel unit entry


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

Recommended Posts

Hi

I'm developing a database that needs to allow users to enter data in either metric or imperial. Which ever is entered results in a simple calculation providing the opposite unit field to be entered. My problem is that the user often is provided with mixed unit measurements by clients. On request I have developed separate screens for both imperial and metric, such that the user can freely flick between units. As stated when the user enters in one unit value a calculation provides the result of the corresponding unit. However if the user then wishes to edit this in the resultant the original entered figure remains unchanged. I'm sure there is an obvious solution to this but all I seem to be doing is going round and round in circles.

Please help if you can

Mant thanks in advance

Andy

Link to comment
Share on other sites

  • 2 weeks later...

There are a few ways to do this depending on exactly what you want. I have set up a number of different variations of this where the user can enter amounts in various units. One method is to have a units field with radio buttons to select the units, and a quantity field where the user enters the quantity. Then, a calculated field converts the input to whatever internal working units you want.

Another option, if you want to have a field for each unit quantity, and have Filemaker convert and fill in the missing ones, you will need a script to check which field has a value entered, and then calculate and enter converted values into the empty fields. Trying to do this with just auto-enter or calculated fields won't work because you will get a circular relationship error (unless you resort to a rather convoluted self-modifying field trick which is usually more trouble than it's worth).

Link to comment
Share on other sites

Andy,

Try this

For each dimension have 4 fileds as follows:

1. Ba_Weight_kg_Input

2. BaX_Weight_kg_Output = Round ( If ( Ba_Weight_kg_Input = "",Bb_Weight_lb_Input / 2.21, Ba_Weight_kg_Input ), 0 )

3. Bb_Weight_lb_Input

4. BbX_Weight_lb_Output = Round ( If ( Bb_Weight_lb_Input = "", Ba_Weight_kg_Input * 2.2, Bb_Weight_lb_Input ) , 0 )

Format them all as numbers.

On one layout have all four fields side by side with the inputs close together and the outputs close together. Whichever unit is entered, the other one is calculated.

Link to comment
Share on other sites

Hi Chris

Many thanks for the email I did something very similar and superimposed an entry field over a calculation field. Such that if the user enters in metric, this figure is used in the imperial calculation, and visa versa. This was made easier as I have a separate metric and imperial screen with a button to switch between the units.

My solution

whatever ins = If(whatever_entry ins =0; whatever_entry mm/25.4; whatever_entry ins)

repeated for all dual entry fields

Again many thanks

Andy McCann

Link to comment
Share on other sites

FAO Bob Weaver

Many thanks for your reply to the question posed. I toyed with radio buttons initially . The problem I faced was that often users would be provided with mixed units from clients so I wanted to create an "on the fly" ability to switch between units. Thus in effect the solution I developed was the same as your second suggestion and the one made by Chris Wood. (Please see response to Chris with the code I used.)

This solution works well however there is one problem I foresee. When a client makes the inevitable spec/dimension changes, but makes these in the different unit to the initial spec. The only way for this to work currently is for the user to first delete the former unit value then switch unit screens and enter the new value. I'm sure there is a simple solution staring at me but I simply can't seem to focus on it.

Again many thanks for your response

Link to comment
Share on other sites

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