Save and New

A

allen davidson

Hi, I'm trying to have a button on a form that saves the current record then
clears the form ready for another record to be entered.

The form is opened from another form like this

DoCmd.OpenForm "frmOrganisation", acNormal, , , acFormAdd, acDialog

The code for the button click is

If Me.Dirty them
Me.Dirty = False
Enf if

I'm using Access 2003. I think I need to use AddNew but not sure how to go
about it.

Regards
Allen
 
A

allen davidson

This seems to work OK (simpler than I was trying)

If Me.Dirty Then
Me.Dirty = False
End If

DoCmd.RunCommand (acCmdRecordsGoToNew)

Any downside of doing it this way?
Thanks
Allen
 
M

Marshall Barton

allen said:
This seems to work OK (simpler than I was trying)

If Me.Dirty Then
Me.Dirty = False
End If

DoCmd.RunCommand (acCmdRecordsGoToNew)

Any downside of doing it this way?

Downside? Not really.

However, you son't need a button for that in most
situations. You can get that effect automatically when the
user just tabs out of the last control in the detail
section's tab order or hits the Page Down key from any
control.
 

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