Macro to open subform

C

Chey

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
 
S

Steve Schapel

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.
 
C

Chey

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
 
S

Steve Schapel

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
 
C

Chey

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 said:
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 said:
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.
 
C

Chey

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 said:
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 said:
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.
 
S

Steve Schapel

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top