Notifying Users of import errors

IceGirlAnne

Registered User.
Local time
Today, 15:31
Joined
Jul 9, 2002
Messages
14
I made an application where the user is to select a file and once selected, it loads into a table. Is there anyway or any code that I could write so that it checks to see if import errors occurred & showed up in the table section, so then I could display a dialog box that explains to the users that there were import errors and to try again, where it goes back to the original form.

Thanks for all of your help!!

:)
 
Sorry, but I don't understand what's happening. A file is selected, then imported into a new table?

If import errors occur under these circumstances, a warning message is automatically generated isn't it?


What is the "original form" you want it to go back to? And what changes will be made to ensure that the import errors aren't endlessly repeated?
 
Hi,

Well, when I run the application I made, if the user chooses a file that's not based like on the import specification I made, an error box doesn't show up, it just continues and creates a report based on no or wrong data.

I just wanted my program to check to see if import errors occurred in the "table section" after the user loaded the file. I don't even know if that's possible. I think I can do the rest, it's just the code I need that tests to see whether import error tables are there or not.

Thanks for your time and help! I really appreciated it!
 
It would be better if you were to stop your user selecting the wrong file at the outset, I think. Is it possible to give your files some identifier which would have to be present to initiate the import?
 
Well, it shouldn't really be a problem if there are import errors, but if the user were to accidentally load the wrong file, I just wanted them to be aware of it from the beginning instead of waiting to see the final report, where the data is all messed up.

Thanks anyway!!!!!!! :) :)
 
IceGirlAnne said:
I think I can do the rest, it's just the code I need that tests to see whether import error tables are there or not.

Try this

Code:
Function fExistTable(strTableName As String) As Integer
Dim db As Database
Dim i As Integer
    Set db = DBEngine.Workspaces(0).Databases(0)
    fExistTable = False
    db.TableDefs.Refresh
    For i = 0 To db.TableDefs.Count - 1
        If strTableName = db.TableDefs(i).Name Then
            'Table Exists
            fExistTable = True
            Exit For
        End If
    Next i
    Set db = Nothing
End Function
 
I use a temp table to import the users data into and allow the users to view the data in a subform, if the data "looks" good, the user click a continue button which appends the data from the temp table into the real table. If the data looks bad, the user aborts (cancels) the import process and nothing was appended to the real table.

HTH
 

Users who are viewing this thread

Back
Top Bottom