Access a button from anther form

A

Ac

Hi,

I have two forms which are View and Edit. The first form displays all
records in a table and second uses to edit record which includes Add, Save
and Delete buttons. If user does not find the record on the View form, he has
to add the new record on the Edit form. Now, switch forms will take time if
there are lots of records to add. I would like to create a button on the View
form called New, When user clicks on the New button, the new record form
with the current record number will be displayed, (just like the user clicks
on Edit form/Add button. How can I write code for New button? Thanks
 
D

DanRoss

If you have a form that work for edits - use that form

in the New Button onclick event

'add

DoCmd.OpenForm "YourEditForm", acAdd

Althoug - for a new Record there should be NO current recordnumber if there
is - then it's not really a new record just edit it.
 
Top