Guest_imported
New member
- Jan 1, 1970
- 0
I have the following code that adds records and closes the form. The problem is, whenver i add a record, close a form and reopen it, i still see the previous added data in the form. They won't clear. Can anybody give me the solution please?
Thanks
Private Sub Add_Click()
On Error GoTo Err_Add_Click
Dim i
DoCmd.GoToRecord , , acNewRec
Me!Text23 = ""
Me!Text45 = ""
Me!City = ""
Exit_Add_Click:
Exit Sub
Err_Add_Click:
If Err.Number = 3022 Then
i = MsgBox(" The Student ID Has To Be Unique", vbOKOnly, "Student Database"
Else
MsgBox Err.Description
Resume Exit_Add_Click
End If
End Sub
Private Sub Close_Click()
On Error GoTo Err_Close_Click
DoCmd.Close
Exit_Close_Click:
Exit Sub
Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click
End Sub
Thanks
Private Sub Add_Click()
On Error GoTo Err_Add_Click
Dim i
DoCmd.GoToRecord , , acNewRec
Me!Text23 = ""
Me!Text45 = ""
Me!City = ""
Exit_Add_Click:
Exit Sub
Err_Add_Click:
If Err.Number = 3022 Then
i = MsgBox(" The Student ID Has To Be Unique", vbOKOnly, "Student Database"
Else
MsgBox Err.Description
Resume Exit_Add_Click
End If
End Sub
Private Sub Close_Click()
On Error GoTo Err_Close_Click
DoCmd.Close
Exit_Close_Click:
Exit Sub
Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click
End Sub