me.visible question

S

Steve Y

I am trying to create a form in which the operator will enter a date that
will be the default date for several sub-reports. I was instructed to creat
an unbound form and add a command button. I was also instructed to code the
click event on this command button to, "Me.Visible=False". I did this, but
now when I open the form, enter the date and then click on the Command
Button, I get a message that reads as follows:

"Microsoft Office Access can't find the macro 'Me.' The macro (or its macro
group) doesn't exist, or the macro is new but hasn't been saved. Note that
when you enter the macrogroupname.macroname syntax in an argument, you must
specify the name the macro's macro group was last saved under."
 
F

fredg

I am trying to create a form in which the operator will enter a date that
will be the default date for several sub-reports. I was instructed to creat
an unbound form and add a command button. I was also instructed to code the
click event on this command button to, "Me.Visible=False". I did this, but
now when I open the form, enter the date and then click on the Command
Button, I get a message that reads as follows:

"Microsoft Office Access can't find the macro 'Me.' The macro (or its macro
group) doesn't exist, or the macro is new but hasn't been saved. Note that
when you enter the macrogroupname.macroname syntax in an argument, you must
specify the name the macro's macro group was last saved under."

Here is how to write code.

Open the Form in Design View.
Select the Command Button.
Display the Command Button's Property sheet.
Click on the Event line.
On the line that says On Click, write:
[Event Procedure]
Then click on the little button with the 3 dots that appears on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines, write:

Me.Visible = False

Save the changes.

Follow the same procedure for the any other event you need to write
code.
 

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