Measurement Conversion

tfaithw

New Member
Joined
Mar 16, 2004
Messages
5
Hello!

I am rather new to Access and have frustrated myself to no end trying to figure this one out....
In a form, I need to be able to enter a measurement in inches and then have it save to my table. I also need to be able to enter it in centimeters, and have it convert to inches, ideally within the same box. I am envisioning having my input box, and then a combo box with "in" and "cm". I have set the default to "in" so if the data is entered in inches, everything is good to go, but i can't for the life of me figure out how to make my input box convert the data from centimeters to inches once the combo box is changed to "cm". (I think I probably just coming back to a circular reference or something, I'm not sure) .

I hope that make sense. Any ideas anyone has would be greatlly appreciated!

Thanks,
Tiffany
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Assuming that you only want to store and display it in inches then you can use the AfterUpdate event of the combobox to change the data for you in code.
Your code would look something like:-
Code:
If Me.cboList = "Cm" Then
   Me.txtInches = Me.txtInches * 0.393700787
   Me.cboList = "In"
End If

shout if you need more detail.

peter
 
Upvote 0

Forum statistics

Threads
1,221,645
Messages
6,161,044
Members
451,682
Latest member
ogoreo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top