I have a height field that I want to store the values as inches, but I want to display them and be able to enter them as feet and inches on the form so they will be entered properly by the user. Is there a way to do this?
I have a height field that I want to store the values as inches, but I want to display them and be able to enter them as feet and inches on the form so they will be entered properly by the user. Is there a way to do this?
Would have to use code to convert the user input to inches and save the value.
Then when you want to display the record with the value as feet and inches have to reverse the calc and populate the textboxes.
Or choose feet/inches from a combo or list box.
What is being measured - people?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes, it is people. How would I set the code up and where exactly does this kind of code go?
I use only VBA. The code could go in the form BeforeUpdate event procedure.
Me!fieldname = Me.tbxFeet * 12 + Me.tbxInches
And the reverse is bit trickier, is the form in Single, Continuous, or Datasheet view?
Me.tbxFeet = Int(Me!fieldname / 12)
Me.tbxInches = Me!fieldname Mod 12
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
um... I don't know. I am using the student template that you can download for access 2007. I am using the student details form.
Doesn't matter. You will have to modify the form as needed.
Sounds like you need to learn how to program in Access. Here's a start https://support.office.com/en-us/art...rs=en-US&ad=US
There is macro equivalent to the VBA I posted. It uses SetValue macro action.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes I do, thank you for the help though. I wasn't even really sure where to start!