disabling button after click() event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Guys!

I would like to disable a button on a form after a user clicks it once and
does some process (ex. import) so they can't use it again until they restart
the whole application. (when I try to do me.button.enabled = false, I get
message "you can't disable control while it has focus")

Also, How do you get a form to close after you direct control to another
form or report. The only form I want to always be visible after clicking a
buttons to open other forms/reports is the switchboard form.

You guys are the best!
 
On Fri, 22 Oct 2004 09:35:17 -0700, MaBell wrote:

See comments in line....
Hi Guys!

I would like to disable a button on a form after a user clicks it once and
does some process (ex. import) so they can't use it again until they restart
the whole application. (when I try to do me.button.enabled = false, I get
message "you can't disable control while it has focus")

Code the Click event:
' You current code here
[SomeOtherControl].SetFocus
Me!CommandButtonName.Enabled = false
Also, How do you get a form to close after you direct control to another
form or report. The only form I want to always be visible after clicking a
buttons to open other forms/reports is the switchboard form.

DoCmd.OpenForm "OtherFormName"
DoCmd.Close acForm, Me.Name
You guys are the best!

Thank you.
 
Back
Top