What is wroing with this this is straight out of (Profesional VB6 databases
by Wrox)
im tring it out to do the problems and it says compile error Sub or function
not defined
TIA
Private Sub cmdAction_Click(Index As Integer)
On Error GoTo qoActionErr
With Adodc1
Select Case Index
Case 0 'Add
If cmdAction(0).Caption = "&Add" Then
varBookMark = .Recordset.Bookmark
.Recordset.AddNew
txtField(0).SetFocus
cmdAction(0).Caption = "&Cancel"
SetVisible False
Else
.Recordset.CancelUpdate
If varBookMark > 0 Then
.Recordset.Bookmark = varBookMark
Else
.Recordset.MoveFirst
End If
cmdAction(Index).Caption "&Add"
SetVisible True
End If
Case 1 'Delete
If Recordset.EditMode = False Then
.Recordset.Delete
.Recordset.MoveNext
If Recordset.EOF Then
Recordset.MoveLast
Else
MsgBox "Must update or refresh record before deleting!"
End If
Case 2 'Find
frmFind.Show
Case 3 'Update
.Recordset.Update
varBookMark = Recordset.Bookmark
.Recordset.Requery
If varBookMark > 0 Then
.Recordset.Bookmark = varBookMark
Else
.Recordset.MoveLast
End If
cmdAction(0).Caption -"&Add"
SetVisible True
Case 4 'Refresh
varBookMark = .Recordset.Bookmark
.Refresh
If varBookMark > 0 Then
.Recordset.Bookmark = varBookMark
Else
.Recordset.MoveLast
End If
End Select
End With
Exit Sub
goActionErr:
MsgBox Err.Desdription
End Sub