Solved

Command Button to Open another form

Posted on 2008-06-23
6
1,847 Views
Last Modified: 2013-11-29
I have attached a screen shot with the relationships of the three tables that are included in my question.

So I have a Form 1 to enter data into the four Requirements Table fields (ID is an auto-gen number)
What I want is a command button on Form 1 that will close Form 1 then open and maximize Form 2.  In Form 2 I want to search through the People Table and find a record.  Then I want to be able to enter in several Roles via Form 2 that will create multiple entries into the Requirements People Table.  It should automatically enter in the ID that is autogenerated after creating a Requirement entry from Form 1, and it should automatically enter the unique Employee ID from the People record that you chose in Form 2.  It should enter these two things into the Requirements People Table for each role (different record) that is chosen.

So my questions are, what would be the VBA code for the command button on Form 1?
How can I set up Form 2 to accomplish this feat?
0
Comment
Question by:Michael2008
  • 3
  • 3
6 Comments
 

Author Comment

by:Michael2008
ID: 21849726
Here is the file, forgot to attach it:
Table-Relationships.JPG
0
 
LVL 13

Accepted Solution

by:
wiswalld earned 500 total points
ID: 21849760
DoCmd.Openform "Form2"
DoCmd.Close acForm, "Form1"

As for the other this is two seperate questions.
0
 
LVL 13

Assisted Solution

by:wiswalld
wiswalld earned 500 total points
ID: 21849770
In the on open for for2

DoCmd.Maximize
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 13

Expert Comment

by:wiswalld
ID: 21849794
What table is form one based on? Will the unique number from form1 also be a unique number on form2?
0
 

Author Comment

by:Michael2008
ID: 21850153
Form 1 is based on the Requirements table, the fields that are entered are Section, Title, Applicability, and Description.  Then ID is simply and autogenerated integer, that is made once for each new data entry into the Requirements Table.  I created it that way so that I would have a primary key to like the Requirements table to the Requirements People table.  It will not be unique on Form 2, as there can be several different people linked with each requirement in various roles.  The Requirements People table has no primary key.  Let me know if you need any other clarifications, and thanks for the help.
0
 

Author Comment

by:Michael2008
ID: 21875651
Ok, since it is two seperate questions and there has been no responses for a while, I have decided to close this question.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question