Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a form in different mode 1

Status
Not open for further replies.

ZmrAbdulla

Technical User
Apr 22, 2003
4,364
0
0
AE
Hi,
I wish to open a form two different mode.
Idea is that, When I click a button called "Edit" the form should open displaying the same record that I am currently viewing. This can be done through the wizards setup.
But When I click button called "Add New Record" the from should open in a new record mode.

How can I create this?

Thanks in Advance.
ZmrAbdulla
 
In the "Add" buttons on click event, this VB code will open the form in add mode:

'Call DoCmd.OpenForm("frmPurchaseInvoice", acNormal, , , acFormAdd)

This will open it in edit mode:
Call DoCmd.OpenForm("frmPurchaseInvoice", acNormal, , , acFormEdit)

If you play with these statments you can also set a filter, so you could get it to open up an existing record to edit.

Hope this helps.
 
Sorry forgot to change, "frmPurchaseInvoice" was the name of the form i was using to test the command, you should put the name of the form you want to open up instead.
 
Hi, Egglar,

Thanks it is working great
ZmrAbdulla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top