Results 1 to 7 of 7

Thread: Pop Up Subform

  1. #1
    Join Date
    Aug 2002
    Posts
    78

    Unanswered: Pop Up Subform

    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.

    Is there a way to do this please?

  2. #2
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    133
    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

    DoCmd.OpenForm "YourForm"

    in the OnClick event of your button.

  3. #3
    Join Date
    Aug 2002
    Posts
    78
    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

    DoCmd.OpenForm "YourForm"

    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

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Does this work with SUBFORMS ?

    Sure it does..

  5. #5
    Join Date
    Aug 2002
    Posts
    78
    Originally posted by CyberLynx
    Does this work with SUBFORMS ?

    Sure it does..
    Thank you how do I set up the sub form to go from the cmd button then please. are you able to tell me how. And if so. ..will you.

  6. #6
    Join Date
    Nov 2003
    Posts
    1,487
    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

    OR

    ' To open in Form (Normal) View:

    DoCmd.OpenForm "mySubFormName", acNormal

    OR

    ' To open in Form (Normal) View with criteria specific:
    Code:
    DoCmd.OpenForm "mySubFormName", acNormal, , "[mySubFormRecSourceTableName]![mySubFormRecSourceTableFieldName] = Forms![mySubFormName]![mySubFormFieldName]"
    Look through the MSAccess help system for OpenForm for more information.

    Hope this helps

  7. #7
    Join Date
    Aug 2002
    Posts
    78
    Thank you. . . Your assistance is greatly appreciated. I will give that a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •