Macro to open subform

Discussion in 'Microsoft Access Macros' started by Chey, Feb 5, 2009.

  1. Chey

    Chey Guest

    I have a subform on the main form. I want to click the command button and the
    form is visable. I can not remember the macro

    My subform name is training providers.

    Thanks
     
    Chey, Feb 5, 2009
    #1
    1. Advertisements

  2. Chey,

    You can use a SetValue action or a SetProperty action to set the Visible
    property of the subform to Yes or No as required.

    --
    Steve Schapel, Microsoft Access MVP

    "Chey" <> wrote in message
    news:...
    > I have a subform on the main form. I want to click the command button and
    > the
    > form is visable. I can not remember the macro
    >
    > My subform name is training providers.
    >
    > Thanks
     
    Steve Schapel, Feb 6, 2009
    #2
    1. Advertisements

  3. Chey

    Chey Guest

    I don't understand. I created a macro and did setvalue, then under item I put
    the form name. What do I do under expression.
    Right now I have the forms property set to visable no. So when I click the
    command button, it should become visable.

    Thanks

    "Steve Schapel" wrote:

    > Chey,
    >
    > You can use a SetValue action or a SetProperty action to set the Visible
    > property of the subform to Yes or No as required.
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > "Chey" <> wrote in message
    > news:...
    > > I have a subform on the main form. I want to click the command button and
    > > the
    > > form is visable. I can not remember the macro
    > >
    > > My subform name is training providers.
    > >
    > > Thanks

    >
     
    Chey, Feb 6, 2009
    #3
  4. Chey,

    The command button is on the main form, right? And you want to show the
    subform, right?

    If so, your macro will be like this...

    Action: SetValue
    Item: [NameOfYourSubform].[Visible]
    Expression: Yes

    --
    Steve Schapel, Microsoft Access MVP

    "Chey" <> wrote in message
    news:...
    > I don't understand. I created a macro and did setvalue, then under item I
    > put
    > the form name. What do I do under expression.
    > Right now I have the forms property set to visable no. So when I click the
    > command button, it should become visable.
    >
     
    Steve Schapel, Feb 6, 2009
    #4
  5. Chey

    Chey Guest

    I am now getting an error message. The object your referene in the visual
    basic editor as an OLE object....

    Any suggestions on what went wrong?

    Thanks

    "Steve Schapel" wrote:

    > Chey,
    >
    > The command button is on the main form, right? And you want to show the
    > subform, right?
    >
    > If so, your macro will be like this...
    >
    > Action: SetValue
    > Item: [NameOfYourSubform].[Visible]
    > Expression: Yes
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > "Chey" <> wrote in message
    > news:...
    > > I don't understand. I created a macro and did setvalue, then under item I
    > > put
    > > the form name. What do I do under expression.
    > > Right now I have the forms property set to visable no. So when I click the
    > > command button, it should become visable.
    > >

    >
    >
     
    Chey, Feb 7, 2009
    #5
  6. Chey

    Chey Guest

    I am now getting an error message. The object your reference in the visual
    basic editor as on OLE object...

    Any suggestions on where I went wrong?

    Thanks.

    "Steve Schapel" wrote:

    > Chey,
    >
    > The command button is on the main form, right? And you want to show the
    > subform, right?
    >
    > If so, your macro will be like this...
    >
    > Action: SetValue
    > Item: [NameOfYourSubform].[Visible]
    > Expression: Yes
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > "Chey" <> wrote in message
    > news:...
    > > I don't understand. I created a macro and did setvalue, then under item I
    > > put
    > > the form name. What do I do under expression.
    > > Right now I have the forms property set to visable no. So when I click the
    > > command button, it should become visable.
    > >

    >
    >
     
    Chey, Feb 7, 2009
    #6
  7. Chey,

    Can you confirm that the command button is on the main/parent form, i.e. the
    same form that contains the subform?

    Can you also confirm that the macro is on the Click event of the command
    button? And that you get this error message when you click the command
    button?

    It is possible for the name of the subform control on the main form to have
    a name that is different from the name of the actual form that is used as
    the subform. Can you please check that.

    Can you give full details of the macro, exactly as you have it at the moment
    please?

    In addition to what you have already told us, is there any other information
    shown in the error message?

    --
    Steve Schapel, Microsoft Access MVP

    "Chey" <> wrote in message
    news:...
    > I am now getting an error message. The object your referene in the visual
    > basic editor as an OLE object....
    >
    > Any suggestions on what went wrong?
     
    Steve Schapel, Feb 7, 2009
    #7
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Plante

    Macro for subform

    Eric Plante, Sep 8, 2003, in forum: Microsoft Access Macros
    Replies:
    12
    Views:
    742
    Steve Schapel
    Sep 18, 2003
  2. Guest

    subform macro won't work now

    Guest, Jan 6, 2004, in forum: Microsoft Access Macros
    Replies:
    0
    Views:
    165
    Guest
    Jan 6, 2004
  3. Guest
    Replies:
    4
    Views:
    741
    Guest
    Nov 1, 2004
  4. Replies:
    2
    Views:
    464
  5. RickSF

    Use Macro to Filter records in Subform on open

    RickSF, Jan 10, 2010, in forum: Microsoft Access Macros
    Replies:
    0
    Views:
    995
    RickSF
    Jan 10, 2010
Loading...

Share This Page