Open a form from another form

kmclane

New Member
Joined
Apr 1, 2004
Messages
42
I have two tables, I have two forms. I can add data to each no problem. I want a user to be able to click a button on the first for which should open the second form, populate a couple of matching fields, and let them add one or more records to the second table. I can't even get the second form to open. I tried to do it in a module, but it keeps giving me a syntax error. this is what I have so far:

DoCmd.OpenForm("Principals",acNormal,,,acFormAdd,acWindowNormal)

Which should open my second form. Or so I thought, any suggestions will be appreciated.

Ken
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Ken

Remove the brackets from

Code:
DoCmd.OpenForm("Principals",acNormal,,,acFormAdd,acWindowNormal)
, like so

Code:
DoCmd.OpenForm "Principals",acNormal,,,acFormAdd,acWindowNormal

In fact, with the arguments you are choosing, you just need this:

Code:
DoCmd.OpenForm "Principals",,,,acFormAdd

The acNormal and acWindowNormal are the default constants for the OpenForm method.

anvil19
:eek:
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top