472,342 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,342 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 12695
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,832 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,511 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...
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...
2
by: Daniel Kster | 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...
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 =...
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 =...
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...
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: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.