Two subforms on a form

C

Cynthia

I have one form with two subforms on it. This is too
crowded and I would like to move the subforms to a
different "page". Can't I put a command button on the
bottom of the first page that says something like "View
Customers Account" and it moves me there?
 
S

Sam

Yes you can...

In the command buttons click event add code like

DoCmd.OpenForm "YourFromName", , , "CustomerID = " & CustomerID

(I think I've got the right number of commas in the above statement!)

HTH
Sam
 
V

Van T. Dinh

Have you tried the TabControl where you can have 2 Tab Pages (occupying the
same screen space) and you can place each Subform on a separate Tab Page.

Check Access Help on TabControl.
 
G

Guest

I'm sorry to be dense but I don't know how to do this. The
only command buttons I have used are the wizards on the
toolbox. I have never done anything on a click event. Do
you mind walking me through this?







-----Original Message-----
 
S

Sam

Actually I think the command button wizard will do this for you.

Once the Command Button Wizard starts...
- Choose Form Operations and Open Form... Next...
- Select the form you wish to open... Next
- Choose open the form and find specific data to display... Next
- Select the matching fields (probably the primary key on the left and
secondary key on the right)... Next
- Enter text/image to appear on the button... Next
- Give the button a name (eg. cmdOpenSubForm)... Finish

Essentially the wizard creates the line of code I originally posted (with
much added fluff). You can view the created code by selecting the command
button in design view. Open view menu then properties. In the properties
window select the events tab, click next to on click and then click on the
.... to see the code.

HTH
Sam
 

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