What are you, specifically, hoping to do -- create a general unit conversion
lookup form, or create code for a limited set of conversions to use in your
application, or ???. Post back with some clarification and there's a good
chance someone can offer useful suggestions.
For example, in the latter of the two cases I mention, this function would
convert
Function HowManyInches (Centimeters as Single) as Single
HowManyInches = Centimeters / 2.54
End Function
You would, of course, want to add some error handling, or perhaps use a more
accurate conversion factor. For a general conversion form, you'd put
similar code in the AfterUpdate event of a Control into which the user
entered the "convert-from" value, but instead of simply returning the value,
as the function above, it would set the calculated value into the control
that is intended to display the "convert-to" value. Or, you could make it
more complicated by allowing the user to choose the convert-from and valid
convert-to units, then enter the value, then use that input to determine the
calculation to perform.
Larry Linson
Microsoft Office Access MVP