Results 1 to 5 of 5
  1. #1
    Stevie is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2022
    Location
    Salisbury, Adelaide
    Posts
    7

    Question Input Mask and Maths for Degrees Minutes Seconds

    I am trying to create a field to store Direction in Degrees Minutes Seconds.

    I will also need to do maths with it. i.e. Criteria >= 03°15'00" .
    I want to subtract a Surveyed AsBuilt Direction (BEARING) from the Designed BEARING then if it is more than the Criteria allowed, the difference in value should show up in the new (ERROR) field.
    I have managed to make the other fields work. They are just normal numbers. Result shown below.
    Any advice will be greatly appreciated. I will also need to limit degrees to < 180, minutes & seconds to <60.
    Click image for larger version. 

Name:	DMS_Snip.png 
Views:	23 
Size:	39.7 KB 
ID:	49302

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Any reason why you can not use separate controls?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Stevie is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2022
    Location
    Salisbury, Adelaide
    Posts
    7
    Controls? Sorry I am a newby. Diving in the deep end perhaps.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Converting DMS to decimal degrees (and the reverse) is a common topic. Numerous code snippets on the web. Could probably search this forum and find several.

    Controls are objects like command buttons, textboxes, comboboxes, labels, etc. - things you put on forms and reports.

    Could use separate textboxes for input of D M S by user. If those textboxes are bound to fields then D M S are saved to table. If input is to UNBOUND textboxes, then use code to convert to DD for saving to record.

    Textboxes have Validation Rule property you can set for limits on user input.
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Quote Originally Posted by Stevie View Post
    Controls? Sorry I am a newby. Diving in the deep end perhaps.
    I was thinking of three separate textboxes, one for each element in the input.

    Admittedly just a little more to input, but a tab key is easy to use?
    Then each portion ccould be validated.
    Another option might be to enter with known delimiter like :, so 98:23:32, then split that to get the relevant elements and validate?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 5
    Last Post: 11-05-2021, 09:37 AM
  2. Maths dependent on input
    By RikApple in forum Access
    Replies: 7
    Last Post: 09-29-2019, 06:32 PM
  3. Format For Minutes:Seconds - Sum Not Working
    By Desstro in forum Programming
    Replies: 4
    Last Post: 04-23-2018, 06:19 PM
  4. Replies: 8
    Last Post: 03-09-2017, 12:14 PM
  5. Minutes and Seconds format for record in Database
    By vegetamaker in forum Access
    Replies: 2
    Last Post: 09-03-2016, 06:31 AM

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