Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21848

[RESOLVED] the exit sub dosnt work and still updates the database

$
0
0
can somebody please tell me why i put a exit sub before i save or update and it stills saves and update
isn't this supposed to exit the routine?:confused:

what is wrong with my code?
this is before i save
before the Insert statment

Code:

If NewRec Then
  Set rs = CN.Execute("SELECT * FROM Inventory WHERE InvParts='" & RplS(Txt(9).text) & "'")
        If Not rs.EOF Then
            MsgBox "this number already exists in the table"
            Txt(9).text = ""
            Txt(9).SetFocus
            Exit Sub
            End If

    Set rs = CN.Execute("select EmpActive from Employees where EmpID=" & FrmEmployees.LsVw.SelectedItem.Tag)
  If Not (rs.EOF And rs.BOF) Then
    Select Case rs![EmpActive]
        Case "day off"
            MsgBox "this employee has a day off you need to select another employee to do this purchase", vbExclamation, ""
    End Select
    End If


Viewing all articles
Browse latest Browse all 21848

Trending Articles