Debug stops at the 3rd line of this code (Set rs =
db.openrecordse t("IMPORT") why?
Private Sub Command118_Clic k()
Dim rs As DAO.Recordset
Set rs = db.openrecordse t("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
cc8345@NOSPAMec lipse.co.uk
db.openrecordse t("IMPORT") why?
Private Sub Command118_Clic k()
Dim rs As DAO.Recordset
Set rs = db.openrecordse t("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
cc8345@NOSPAMec lipse.co.uk
Comment