Results 1 to 5 of 5
  1. #1
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83

    Data Validation of another field

    I am trying to make a data validation rule of Field1 equal to Field2 (sounds silly but I need to make sure the data I am importing has no errors in the source data).

    I tried the data validation rule in Field1 "= Field2" but it did not work. Is this possible to do? Thanks.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I don't think it should be done in access. thinking about it, if you set a rule like that at a table level, then import data that violates it, you're gonna see this:
    'X' records were not imported due to validation errors
    Hence, doing this is probably irrelevant if you want all data from your source.

    If you want no import errors or extra work to do when validation errors occur on import, why not validate the data in the source before it comes in?

  3. #3
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    I wanted to create this to remind to me check because last time I forgot. When there is a field1 value there should be a field2 value however this depends on other parameters the end user might miss and therefore that system might not show a field2 value. I want to catch these small mistakes on my end and remind me at the same time. 99% of the time there is a field1 and field2 value.

    I guess i can always go to VBA to check the table, i just thought there was an easier way in table properties.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    again, I'm pretty sure the import will error if you DO figure out how to do it. Why don't you just write a small procedure in vba to run after the import. say something like:
    Code:
    docmd.runsql "update table set [field1] = [field2] where [field1] is null"

  5. #5
    dssrun is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    83
    ya that is a good plan and that is easy enough to create and setup. Thanks.

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

Similar Threads

  1. Form Field Validation
    By dhav79 in forum Forms
    Replies: 3
    Last Post: 06-03-2010, 11:31 AM
  2. Linked Table Field Validation
    By yuriyl in forum Access
    Replies: 4
    Last Post: 04-20-2009, 01:31 PM
  3. Referencing table data in field validation rule
    By toad848 in forum Database Design
    Replies: 3
    Last Post: 03-19-2009, 07:03 AM
  4. Data Validation - Please help
    By larry S in forum Access
    Replies: 0
    Last Post: 11-16-2008, 10:24 PM
  5. Validation rule for a text field
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 03-14-2006, 11:39 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