Visibility in a command button

G

Guest

I have a form that I enter a date and click an Ok button. Once that button
is clicked another form opens that requires data. After that data is entered
a button is clicked that starts the macro which runs for quite a while.
While that macro is running, I want the date to show on the first form but
not the Ok command button or the cancel button and I have tried to set the
visiblity as such:

Private Sub Ok_Exit(Cancel As Integer)


Me.Ok.Visible = False
Me.Cancel.Visible = False
Me.Label0.Visible = False

End Sub

So I would think that once the macros start running this form would remain
open displaying the date but nothing else.

I have tried to use this same code on the After Update Event on the form
after the entry of the date in the date text box using this code:

Private Sub Date_AfterUpdate()

If Date = Null Then
Me!Ok.Visible = False
Me!Cancel.Visible = False
Me!Label0.Visible = False
Else
Me!Ok.Visible = True
Me!Cancel.Visible = True
Me!Label0.Visible = True
End If

End Sub

None of these seem to work. Can someone please help!!??


Rob
 
K

Ken Snell \(MVP\)

Put those code steps in the Click event of the OK button. The Exit event of
that button occurs only when the focus is moved away from the button to
another control on the form.
 

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