View Single Post
  #4  
Old December 6th, 2006, 05:21 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Disable Command Button

On Wed, 06 Dec 2006 15:44:51 GMT, mdavis via AccessMonster.com wrote:

Sorry I did not give the proper info.
Form B is the main form and is already opened. The user clicks a command
button called ADD (on Form B) that takes them to a pop up form (Form A).
Then if the user clicks the SAVE command button I want the ADD command button
to be disabled on Form B.

I added the code you gave me but I get an error that says "You can't disable
a control while it has the focus". Do you know what the code would be to fix
this?

Thanks for all your help.

fredg wrote:
I would like to click a command button called "Save" on Form "A" and as Form
"A" closes and returns me to Form "B" I would like to make a command button
on Form "B" to be disabled.

Thank you in advance.


What do you mean by 'and returns me to Form "B"?
Is Form B opened by Form A?

In the Command Button Save click event:

' Place your current Save code here.
DoCmd.OpenForm "FormB"
forms!FormB!CommandButtonName.Enabled = False


Sure.
Forms!FormB!AnyOtherControl.SetFocus
Forms!FormB!CommandButton.Enabled = False
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail