After Save Button .. goto new blank form

ezykiwi

Registered User.
Local time
Today, 20:50
Joined
Sep 5, 2006
Messages
33
Howdy all,

The other night I was playing around and deleted code from my database, which now seems to have stopped allowing me to continue to a blank form after I add a record....

It used to work, that once I pressed the save button it would then goto the same form but the form would have the same defaults as if id just opened the form.... now im getting #deleted

Is there any code I can put in the save button to get it back to the way it was before?

Cheers Ezy
 
Well i dont know exactly what you mean but this is what i use to save documents then open with a new black page to add another. This is access 97 version.

This is on the save button:
Code:
Private Sub btnSave_Click()
'Save command:
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

'Refresh command:
    DoCmd.Close
        DoCmd.OpenForm "YourFormName"
End Sub

This is on the form open command:
Code:
Private Sub Form_Open(Cancel As Integer)
'Create new record command:
    DoCmd.GoToRecord , , acNewRec
Me.cmdDud.SetFocus
End Sub
 
If using the same form to continue a new record add (The next line after the save)

DoCmd.GoToRecord , , acNewRec
 

Users who are viewing this thread

Back
Top Bottom