Debug stops at the 3rd line of this code (Set rs =
db.openrecordset("IMPORT") why?
Private Sub Command118_Click()
Dim rs As DAO.Recordset
Set rs = db.openrecordset("IMPORT")
With rs
.MoveFirst
prev = !NOM_ACCOUNT
.MoveNext
Do
Select Case prev
Case "1700"
If !NOM_ACCOUNT <> "2300" Then
MsgBox "There has been an error in row # " & !NOM_ID & vbCrLf &
"Validation failed", , "Error"
Exit Sub 'or Exit Function
End If
Case "2300"
If !NOM_ACCOUNT <> "3200" Then
MsgBox "There has been an error in row # " & !NOM_ID & vbCrLf &
"Validation failed", , "Error"
Exit Sub 'or Exit Function
End If
Case "3200"
If !NOM_ACCOUNT <> "1700" Then
MsgBox "There has been an error in row # " & !NOM_ID & vbCrLf &
"Validation failed", , "Error"
Exit Sub 'or Exit Function
End If
End Select
prev = !NOM_ACCOUNT
.MoveNext
Loop Until .EOF
.Close
End With
Set rs = Nothing
Set db = Nothing
End Sub
--
Thanks,
Chris
cc****@NOSPAMeclipse.co.uk