I am working on a db and some of the questions on applications are not required for all of the types of applications this non profit takes. Thus instead of putting it in a form and taking up real estate. . . I was hoping to make it so if you press a cmd button, it will pop up this subform so information could be put there.
Originally posted by bmacr
One of the best ways to save real estate is to use a Tab Control. Just put the required objects on a different page. If you want to use a separate form, put
in the OnClick event of your button.
Does this work with SUBFORMS ?
I have an Applications tbl related to contacts table.
I have two foms that with 1 to many relationships that need to relate to the Applications table. References and Income.
I have income working but get a dupcate primary key entry error message when I add the References sub form. it is set up EXACTLY the same way as the Income sub form (BTW i am using Tab control) thanx for the tips
If you have allready created the SubForm (via wizard or whatever) then most of the battle is won, you have the SubForm name and structure you want. All that is needed now is, do you want the SubForm displayed in Form view or DataSheet view. I will show you how to initiate either one. I will assume here that your SubForm name is call mySubFormName.
1) Place your main Form into Design View.
2) From your database Controls tool bar select the command button and place it on your form. Cancel the format wizard should one popup.
3) In the properties window, locate the Caption property for the new Command button. Enter the name "OpenMySubForm". You can name this to whatever you want displayed in the button.
4) Select the Event tab located at the top of the properties window and locate the On Click event. Double-click in the empty field for the On Click event. The field will automatically be filled with Event Procedure. To the far right of the event field select the box with 3 dots in it. This will open the code window and place the mouse cursor within the new event.
5) Enter the following code within the On Click event of your new Command button:
' To open in DataSheet View:
DoCmd.OpenForm "mySubFormName", acFormDS
' To open in Form (Normal) View:
DoCmd.OpenForm "mySubFormName", acNormal
' To open in Form (Normal) View with criteria specific: