Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Command Button to Open another form

Posted on 2008-06-23
Medium Priority
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?
Question by:Michael2008
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Author Comment

ID: 21849726
Here is the file, forgot to attach it:
LVL 13

Accepted Solution

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

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

Assisted Solution

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


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 13

Expert Comment

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

Author Comment

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.

Author Comment

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.

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

604 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