You don't want to do this with two forms! When a single
Record needs more space than can be accommodated on a single screen, without scrolling, you need to use a
Tabbed Control.
Tabbed Controls are normally used in one of two ways
- To enter/display data in a logical manner from a single RecordSource when one screen won't display all of the Controls for the Record
- To enter/display data and related data from multiple RecordSources using subforms on the Tabbed Pages.
An example of
#1 would be an employee database.
- Page 1 could hold personal information, i.e. name, age, gender, SSB, etc
- Page 2 contact info, i.e. address, home phone number, cell phone number, etc
- Page 2 education info, high school attended, colleges attended, degrees held
All of the above data would be
based on a single table.
An example of
#2 would be a products/services database.
- Page 1 could hold Customer information, i.e. name, contact person, address, phone number
- Page 2 payment/credit info, i.e. bank info, credit card numbers, in-house credit limits
- Page 3 services ordered info; type of services, dates requested, costs quoted
- Page 4 products ordered info; products, quantity, cost-per-unit
The data on these pages would be based on
four different but related tables, one for each
Tabbed Page.
Your situation, with a survey type form, would fall into the first example given above. Here's a quick little tutorial I give people on the use of
Tabbed Pages. It addresses some of the common problems experienced with them:
First thing to remember is that the
Tabbed Pages are all part of a single form; think of it as a really long form turned on its side. Because it is all one form, all referencing to any control on it is done in the same manner as if they were all on one single screen. Create a form in
Design View. Goto the toolbox and click on the
Tabbed Control Icon; it actually looks like several manila file folders. Place it on your form and adjust the size to your liking. If you need more than the two tabbed pages it initially gives you, click on the tabbed control to select it. Goto
Insert and click on
Tabbed Control Page and another tabbed page will be added. Do this as many times as necessary.
This is the really important part: when you go to add a control to a tabbed page, whether it be a textbox, command button or subform, you must first click to select one of the pages, then add the control. Otherwise, the control will be added to the form itself, and will show thru on all tabbed pages! If a single page has been selected, when your cursor carrying the control appears over the page, a black "insert" will appear.
Once you have the form's
Control Source (your table or a query) set up, you simple add controls as you normally would, heeding the above paragraph.
Also important to understand! If you go to move a control from one part of your main form to a tabbed page, you cannot drag and drop it! You must cut it, select the tabbed page, then paste it! And if the control has any code behind it, a GotFocus, OnClick, etc, after dropping it on the tabbed page, you'll have to "re connect" it to its code. Select the control, goto Properties, click to the right of [Event Procedure] on whatever event to bring up the ellipsis (...) then click it to go to the code window. Exit the code editor and the control and its event code will be connected.
One last thing. When trying to access the
Properties of the
Tabbed Control, such as the BackStyle, people complain that they can't find the property. The problem is that they haven't selected the
Tabbed Control, they've selected one of the pages of the
Tabbed Control! The best way to be sure of selecting the Tabbed Control itself is to click to the right of the last tab. If you have 2 tabs, for instance, click in the blank area where Tab 3 would be, if you had a Tab 3.
Linq
;0)>