Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Thanks larry for yur help. I t

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
Thanks larry for yur help. I tried it and there is an error. It says object or method not found at DoCmd.Undo


Here is the latest code:


Private Sub Add_Click()
On Error GoTo Err_Add_Click
Dim i

DoCmd.GoToRecord , , acNewRec

Exit_Add_Click:
Exit Sub

Err_Add_Click:

If Err.Number = 3022 Then
If MsgBox("The Student ID has to be unique. Click on OK to change or Click on Cancel to erase.", vbOKOnly, "Student Database ") = vbCancel Then
DoCmd.Undo
Else
Exit Sub
End If
Else
MsgBox Err.Description
Resume Exit_Add_Click
End If


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top