473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Convert feet & inches to metres

Have 3 text boxes.

Feet, inches and metres.

As I type in feet then inches, I would like to convert this to metres and place the result in the metres text box as soon as I tab on to the next field.

Can anyone help, please?
Feb 12 '07 #1
6 12881
Michael R
176 100+
Have 3 text boxes.

Feet, inches and metres.

As I type in feet then inches, I would like to convert this to metres and place the result in the metres text box as soon as I tab on to the next field.

Can anyone help, please?
Yes, add this code to both inches and meters text boxes After Update events:

Expand|Select|Wrap|Line Numbers
  1. Me.Meters.Value = Me.Feet.Value * 0.305 + Me.Inches.Value * 0.025
Michael.
Feb 12 '07 #2
ADezii
8,834 Expert 8TB
Have 3 text boxes.

Feet, inches and metres.

As I type in feet then inches, I would like to convert this to metres and place the result in the metres text box as soon as I tab on to the next field.

Can anyone help, please?
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtInches_AfterUpdate()
  2.   'The conversion formatted to 2 decimals places
  3.   Me![txtMeters] = Format(((Nz(Me![txtFeet]) * 12) + Nz(Me![txtInches])) / 39.36, "#,#,#.##")
  4. End Sub
Feb 12 '07 #3
Thank you, Michael.

Calculated field calculates fine now. How do I place the calculated value (now in a text box on a form) back into the underlying table?
Feb 12 '07 #4
ADezii, thank you.
Feb 12 '07 #5
Michael R
176 100+
Calculated field calculates fine now. How do I place the calculated value (now in a text box on a form) back into the underlying table?
You create a field Meters in the underling table and use it in the form as Meters text box control.
Feb 12 '07 #6
NeoPa
32,556 Expert Mod 16PB
It's not a good idea to store two items which are equivalent in the record together. If the Meters control is bound though, but the Feet & Inches controls are not that is a neat facility.
Feb 12 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: HMS Surprise | last post by:
I am working with an ARM946ES processor running C under Nucleus. I need to take time and date (year, month, day, hour, minute, second) from an external RTC chip and convert it to time_t to reset...
1
by: ghostnguyen | last post by:
Hi all I read data from a website and encoding in UTF8. So the result I had like this: và resumes trực tiế How can convert the "ự" (and these string like this) to Unicode character.
2
by: Daniel Köster | last post by:
Hi I asked this question a couple of days ago as well but I didn't get any answers that I could use. Is there someone who has got som tips on how to convert text encoded with character referense...
1
by: SpookyTooth | last post by:
I am trying to write a program that will convert a height of a person from feet and inches to centimeters. I want to use the relationship: 1 foot = 30.48 cm and 1 inch = 2.54 cm. I am trying to get...
3
by: SpookyTooth | last post by:
I am trying to write a program that will convert a height of a person from feet and inches to centimeters. I want to use the relationship: 1 foot = 30.48 cm and 1 inch = 2.54 cm. I am trying to get...
4
by: keith | last post by:
I am writing a simple program to convert mm to feet and inches. I have it as follows: #include <stdio.h> #include <math.h> void main() { int x=11; float mm=0; float answer=0;
7
by: 一首诗 | last post by:
Is there any simple way to solve this problem?
2
by: Rob | last post by:
Hi Gurus, Is there any way to convert Centimeter or Inches to Pixel. Thanks for any help you can provide. Rob.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.