Results 1 to 4 of 4
  1. #1
    crxftw is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    30

    Validation in main and subform


    Hello. I need help to figure out how I can verify that the number (Hours) I have entered in my main form match to the number I have to enter in my sub-form. In my database I assign total hours worked for one sale and then there is an employees tab where I have to put how many hours each or one employee (depending how many were working for that sale) worked. For example if total hours for a sale are 4. And 2 employees work for that then I (usually) split it 2 and 2 for both. But how I can make a validation check so that I don't make a mistake before saving the data in tables. Sale hours must always be equal to the sum of hours that are assigned for employees. Attached a picture how the forms are set up. Hope you can help!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Perhaps this link is what you are seeking: http://access.mvps.org/access/forms/frm0031.htm

  3. #3
    crxftw is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    30
    If I refer to unbound field in subforms footer which sums the employee hours then this way I must enter employee hours BEFORE filling the hours on Sale Details page in order to get this validation to work, but perfect way would be if I enter hours on Sale Details first, then fill the hours on Employee hours, and before submitting I get a notification that I am aware of Employee hours exceed the Sale Details hours so, because it actually can sometimes not be equal. If that makes sense.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is there a question in there?

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

Similar Threads

  1. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  2. opening a second form from main/subform
    By PJPCVP in forum Database Design
    Replies: 1
    Last Post: 10-29-2010, 09:50 PM
  3. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 AM
  4. Exporting main table AND subform
    By jenny28 in forum Import/Export Data
    Replies: 0
    Last Post: 05-10-2007, 11:40 AM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 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