Results 1 to 5 of 5

Validation Rule on a form

  1. #1
    mismag is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2019
    Location
    California, US
    Posts
    31

    Validation Rule on a form

    Hi,



    I have this form to enter monthly car sales data.
    I want to write a validation rule so i don't want to enter one salesperson's data twice in a given month.

    That is the values i entered in the fields "Sales Date", "Dealership Name" and "Full Name", combined together should not repeat.
    Attached is the form sample.

    Thanks in Advance.
    Happy Friday everyone.

    Regards,
    Mismag
    Attached Thumbnails Attached Thumbnails Validation rule.JPG  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    46,888
    Validation Rule will not help with that. Options:

    1. set SaleDate and salesperson as compound index in table and let Access notify users when record fails to commit because of duplication

    2. filter combobox to not show sales people who already have record for the entered date - this is called cascading combobox

    3. code in form BeforeUpdate event validates data
    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
    mismag is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2019
    Location
    California, US
    Posts
    31
    June7,

    set SaleDate and salesperson as compound index in table and let Access notify users when record fails to commit because of duplication
    Can I do this to already designed table?


    Thanks,
    Mismag

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    46,888
    Yes, table in design view, click Indexes on Design tab. You might Bing or Google the topic for more details.
    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
    mismag is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2019
    Location
    California, US
    Posts
    31
    Watching videos on how to create compound index, while waiting for the reply.
    Thanks a lot.

    Regards,
    Mismag

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

Similar Threads

  1. Form Validation Rule from Another Query
    By CodenameAter in forum Forms
    Replies: 11
    Last Post: 05-28-2017, 07:41 PM
  2. Replies: 2
    Last Post: 06-16-2015, 02:52 AM
  3. Form Validation Rule
    By galkej in forum Forms
    Replies: 4
    Last Post: 07-01-2012, 05:38 PM
  4. Validation Rule in Table vs. Form
    By LanieB in forum Forms
    Replies: 2
    Last Post: 03-12-2012, 02:27 PM
  5. Validation Rule Form AfterUpdate
    By GraemeG in forum Programming
    Replies: 6
    Last Post: 02-09-2011, 09:22 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
  •  
Tech Forums: Microsoft Office Forums