Results 1 to 2 of 2
  1. #1
    ExcessionOCP is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    31

    Best way to error-check rows in a table

    Hi,

    I have a table that is populated from an excel import obtained from a separate system that uses different data types to my DB. This is then parsed by a function I have written which loops through the various values in the import table and and, using lookup tables, converts their IDs and imports them into my db.



    This is working correctly, but often the entries in the import table are incorrect or missing.

    I want to write an error-checking function but can't decide on the best way to achieve this.

    My current thinking is:

    For missing values - read each line from the import table and then check to see if any of the fields are null. If they are, add the field name to an array, then open up a form that will hold a bunch of combo boxes that allow the user to select missing values (this form will have combos for all fields in the table, some of which will be populated by the table data, others won't.

    For incorrect values - for each field in the import table, verify that a valid lookup can be performed, and if not, open the form again to allow the user to replace the incorrect items with correct ones pulled from the various lookup tables.

    Does this sound like a remotely practical plan? I fear that it's going to be really slow. Does anyone have any better ideas?

    Cheers,

    Phil

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    For 1) I think I'd open a recordset, applying the criteria as "...WHERE Field1 Is Null OR Field2 Is Null OR..." . If the rs count is zero, don't bother opening second form for adding values. If > 0 you can open the second form and base its record source on the same sql statement or pass the rs to the second form (don't think I have ever done that). If passing the rs is doable then you already have a rs that you can edit with the form controls. Or you could create the rs in a standard module and that way, either form should be able to work with the rs.

    How do you identify 'incorrect' values? The 2nd approach might just be the same as the 1st.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 5
    Last Post: 06-26-2014, 12:52 PM
  2. Check boxes at end of rows
    By NickC in forum Database Design
    Replies: 1
    Last Post: 06-26-2014, 08:37 AM
  3. Replies: 9
    Last Post: 05-30-2014, 11:08 AM
  4. Replies: 3
    Last Post: 09-26-2012, 01:39 PM
  5. Query to check for a CERTAIN amount of rows
    By taimysho0 in forum Programming
    Replies: 8
    Last Post: 05-30-2012, 10:48 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