F
frank
In my table I do not allow duplicates for one of the
fields that is being imported (year). I want to give the
user the ability to select to add records with non-
duplicated years or add none of the records in the
attempted imported file.
so I've created this error trap to try to get rid of the
default error message that comes up when I try to import
data, but it shows up after the default error message. Can
anyone help?
BTW, (DoCmd.RunMacro "IMPORTorEXPORT.importData_EST") is
causing the error
Private Sub Command21_Click()
On Error GoTo ErrorTrap1
If Me.selectLog.Value = 1 Then
If MsgBox("Are you sure you want import Navy Log, OSHA
Log, and Est. Info data?", vbYesNo, "Confirm Delete") =
vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_NAVY"
DoCmd.RunMacro "IMPORTorEXPORT.importData_OSHA"
DoCmd.RunMacro "IMPORTorEXPORT.importData_EST"
ElseIf Me.selectLog.Value = 2 Then
If MsgBox("Are you sure you want import OSHA Log data?",
vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_OSHA"
ElseIf Me.selectLog.Value = 3 Then
If MsgBox("Are you sure you want import Est. Info
data?", vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_EST"
ElseIf Me.selectLog.Value = 4 Then
If MsgBox("Are you sure you want import Navy Log data?",
vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_NAVY"
End If
ErrorTrap1:
MsgBox ("Error")
Exit Sub
End Sub
Thanks,
Frank
fields that is being imported (year). I want to give the
user the ability to select to add records with non-
duplicated years or add none of the records in the
attempted imported file.
so I've created this error trap to try to get rid of the
default error message that comes up when I try to import
data, but it shows up after the default error message. Can
anyone help?
BTW, (DoCmd.RunMacro "IMPORTorEXPORT.importData_EST") is
causing the error
Private Sub Command21_Click()
On Error GoTo ErrorTrap1
If Me.selectLog.Value = 1 Then
If MsgBox("Are you sure you want import Navy Log, OSHA
Log, and Est. Info data?", vbYesNo, "Confirm Delete") =
vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_NAVY"
DoCmd.RunMacro "IMPORTorEXPORT.importData_OSHA"
DoCmd.RunMacro "IMPORTorEXPORT.importData_EST"
ElseIf Me.selectLog.Value = 2 Then
If MsgBox("Are you sure you want import OSHA Log data?",
vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_OSHA"
ElseIf Me.selectLog.Value = 3 Then
If MsgBox("Are you sure you want import Est. Info
data?", vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_EST"
ElseIf Me.selectLog.Value = 4 Then
If MsgBox("Are you sure you want import Navy Log data?",
vbYesNo, "Confirm Import") = vbNo Then Exit Sub
DoCmd.RunMacro "IMPORTorEXPORT.importData_NAVY"
End If
ErrorTrap1:
MsgBox ("Error")
Exit Sub
End Sub
Thanks,
Frank