Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by Pada View Post
    Wedshgasman, because that approach doesn't work.
    So why not just say so and continue on that thread?



    After all, all you are doing is summing four controls and ensuring they come to 100 only.
    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

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Your expression is wrong because of the brackets - ,0 needs to be outside the brackets. But it is true that if it weren't for the division by 100, the numbers coming from text fields would concatenate instead of add. So either fix the fields or use Val() function.
    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. #18
    Pada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2023
    Posts
    44
    Quote Originally Posted by June7 View Post
    Your expression is wrong because of the brackets - ,0 needs to be outside the brackets. But it is true that if it weren't for the division by 100, the numbers coming from text fields would concatenate instead of add. So either fix the fields or use Val() function.
    Great, June7. Thank you for your advice. I will take notes.

  4. #19
    Pada is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2023
    Posts
    44
    Quote Originally Posted by Welshgasman View Post
    So why not just say so and continue on that thread?

    After all, all you are doing is summing four controls and ensuring they come to 100 only.
    Sorry to bother you guys, but I would like to start fresh to clear up my mind. If I stayed in the same spot, I might be drowned myself in confusion and a foggy brain.

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by Pada View Post
    Sorry to bother you guys, but I would like to start fresh to clear up my mind. If I stayed in the same spot, I might be drowned myself in confusion and a foggy brain.
    Take a step back, take a deep breath and think of what you want to do.
    Build it up in small steps, then put code around it if need be.

    In the BeforeUpdate event of the form, I would just sum those controls with NZ() as June7 advised, and if not 100 then set it's Cancel property.
    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

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-23-2020, 02:00 PM
  2. Replies: 8
    Last Post: 06-02-2018, 11:23 AM
  3. Replies: 2
    Last Post: 12-29-2015, 08:32 AM
  4. Replies: 4
    Last Post: 10-10-2014, 02:39 PM
  5. Replies: 2
    Last Post: 08-07-2014, 07: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