Issue setting form field visible = false

  • Thread starter Thread starter AJ
  • Start date Start date
A

AJ

I have a clear button and when I click it I have some vba code that I want
performed.
Example (does NOT work):
.... cmdOK_Click()
[Forms]![form1]![field1].Visible = False
[Forms]![form1]![field2].Visible = False
call sub ABC

The code does not work (it calls the sub but does not set the fields to
invisible. BUT, if I add a msgbox it works fine??? Can anyone explain why??

Example (does work):
..... cmdOK_Click()
[Forms]![form1]![field1].Visible = False
[Forms]![form1]![field2].Visible = False
msgbox"code works if I use this"
call sub ABC

HELP!! Thanks!!
 
Please disregard this post.
Someone on another post suggested to use doevents and it worked great!!
Thanks.
 

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

Back
Top