Clear a form

N

NicoleDBS

I have written some code that works, but I need to have the form clear the
current record after printing the current record. I was getting an error
message that said I was creating dupes, but was able to fix that by removing
the PK and having it indexed with duplicates okay. Please take a look at the
code and let me know what else needs to be done to clear the form.
THANKS in advance.
Private Sub Command106_Click()
On Error GoTo Err_Command106_Click

Dim stDocName As String
Dim MyForm As Form

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecord , stDocName, acNewRec



Exit_Command106_Click:
Exit Sub

Err_Command106_Click:
MsgBox Err.Description
Resume Exit_Command106_Click

End Sub
 
K

Klatuu

Your code has been deprecated since version 2000. You should not use the
DoMenuItem. Also, that whole approach to coding is almost impossible to
read.

There really is no such thing in Access as clearing the current record. The
only thing you can do is go to a new record, which you are doing, but I
can't tell for sure what you are doing before that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top