Results 1 to 7 of 7
  1. #1
    beaverx37 is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    16

    Displaying Height as Feet and Inches

    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?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  3. #3
    beaverx37 is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    16
    Yes, it is people. How would I set the code up and where exactly does this kind of code go?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  5. #5
    beaverx37 is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    16
    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.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  7. #7
    beaverx37 is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    16
    Yes I do, thank you for the help though. I wasn't even really sure where to start!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 11-03-2014, 04:03 PM
  2. Change Height of Box to height of textBox
    By oxicottin in forum Reports
    Replies: 7
    Last Post: 03-15-2013, 09:54 PM
  3. Replies: 4
    Last Post: 09-15-2012, 07:31 PM
  4. Replies: 1
    Last Post: 09-12-2011, 10:22 AM
  5. Replies: 0
    Last Post: 12-23-2008, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums