By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

Using a button to launch a second, linked form

P: 3

It has been a while since I have used Access and even then it was basic use. I think I am thus a little in over my head! Some advice would therefore be much appreciated.

The data input form for my database is essentially made up of 3 sections:
1) item description
2) where from
3) where going to

In order to prevent the main form from getting too cluttered, I want the relevant controls for section 2 (and again for section 3) in a separate - but linked - form that is opened (in a new window) at the click of a button.

I have managed to get as far as using a button to open another form. BUT, the forms don't appear to be linked: when tested, the dummy data used in the second (sub) form didn't appear in the associated fields in the underlying table(s) and warnings that I hadn't entered "required" fields [which were already completed in the first (main) form] were displayed.

[I should say, I do NOT want to view see the data on the sub-form unless I click the understanding of the sub-form function built into Access is that it is not appropriate here????]

I am also a little puzzled as to what to do once the sub-form has been completed: I need the data to save and to return to the main form...

Clearly, I am missing something... if you could give me a hint (or two!!!) I would be grateful.

Jan 6 '16 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 5,397
Have you considered using a tabbed control?
) Using Tabbed Pages on a Form
) Accessing Tabs on a Tab Control
) Create a tabbed form - the very basics

You can also add true subforms to the pages, many of us that do so, do so, via a "late binding" method; however, from your post, I don't believe that subforms are the way to go here... just a plan, simple, tab-control.
Jan 6 '16 #2

Expert 100+
P: 1,107
I whole heartedly agree that a Tab control is probably what you want. I use it often and it works well.

The one thing that struck me odd was the comment:
[I should say, I do NOT want to view see the data on the sub-form unless I click the understanding of the sub-form function built into Access is that it is not appropriate here????
Typically, a Tabbed control will give you additional Screen Space to add fields from the Table that Form is currently based on.

A Subform gives you the ability to display information from a table that differs but is related to the Table that the Form is currently based on. An example of this is a Form to show order information. It would be based on the Orders table, but a Subform on that Form would show the Order lines from a different table that could be called OrderLines. Multiple Subforms like this fit on Tabs quite well.

Typically, the case of showing data or entering data only when a button is clicked is more of a dialog situation, where either the Data or the Validation of the Main Form varies greatly from what is needed to be displayed or gathered from the user. One example is using a Dialog Form to enter a New Order Line in the Order/Order Lines scenario, as the information needed for a new Order Line may rely on some advanced look up features that wouldn't fit on the standard Form display. Another (poor) example would be a Totals Form for the Order/Order Lines that would only be available when a manager is using the database so that dollar values aren't shown to anyone but managers.

When you need a dialog, use can do something like the following (there are lots of variations on this):
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "NewOrderLine", acNormal, , , acFormAdd, acDialog
  2. Me.Refresh
The first line opens the Form as a Dialog, the second line refreshes the Main form after the Dialog Form has been closed.

The Tab Control is probably all you need, but hopefully this helps you understand your options a little better.
Jan 7 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.