Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Close Main Form (A2K)

    I have a main form that has 4 sub forms w/visible=False.

    The main form tracks the user's time and offers them the options to add additional time. Included on the main form is an Option box with 4 options. If the user selects option 1, form1.visible=True and opens, if option2, then form2.visible=true and form2 opens, etc. Each subform has a "CLOSE" button.

    If the user selects option 1 and form 1 opens, the user inputs the data. When the user selects "Close", I want the Main form and the subform to close.

    I have the following code but it doesn't work, can someone tell this pea brain what she's doing wrong?

    Thanks,

    Code:
    --------------------------------------------------------------------------------

    Forms!fTC.Close
    --------------------------------------------------------------------------------


    "returns: Application-Defined or Object-Defined error"
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Close Main Form (A2K)

    The syntax to close a form is

    DoCmd.Close acForm, "NameOfTheForm"

    where NameOfTheForm is the name of the main form (you can't close a subform).

Posting Permissions

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