PC Review


Reply
Thread Tools Rate Thread

Visibility in a command button

 
 
=?Utf-8?B?Um9i?=
Guest
Posts: n/a
 
      1st Aug 2007
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


 
Reply With Quote
 
 
 
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      1st Aug 2007
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.

--

Ken Snell
<MS ACCESS MVP>


"Rob" <(E-Mail Removed)> wrote in message
news:19C6F8A5-69BD-49FC-919B-(E-Mail Removed)...
>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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button Visibility =?Utf-8?B?bmVlbm1hcmll?= Microsoft Access Form Coding 6 30th Aug 2006 06:06 PM
Re: Command Button Visibility Dirk Goldgar Microsoft Access 0 25th Jun 2004 03:25 AM
Visibility of a command Button Al Bundy Microsoft Excel Programming 2 7th May 2004 11:59 PM
Re: Visibility of a command Button Bob Phillips Microsoft Excel Programming 1 7th May 2004 11:46 PM
Re: Visibility of a command Button Jake Marx Microsoft Excel Programming 0 7th May 2004 11:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:53 PM.