If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Disable Command Button
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. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#2
|
|||
|
|||
Disable Command Button
On Mon, 04 Dec 2006 22:52:41 GMT, mdavis via AccessMonster.com 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 -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Disable Command Button
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
Disable Command Button
Works like a charm. Thanks again.
fredg wrote: Sorry I did not give the proper info. Form B is the main form and is already opened. The user clicks a command [quoted text clipped - 22 lines] DoCmd.OpenForm "FormB" forms!FormB!CommandButtonName.Enabled = False Sure. Forms!FormB!AnyOtherControl.SetFocus Forms!FormB!CommandButton.Enabled = False -- Message posted via http://www.accessmonster.com |
#6
|
|||
|
|||
Disable Command Button
One more thing. When I close Form B and reopen it the command button is
enabled. I would like the command button to be disabled as long as Combo Box B has a value in it. If there isn't a value in the Combo Box than I would like the Command Button to be enabled. Could you please help me with the code for this? Thank you. fredg wrote: Sorry I did not give the proper info. Form B is the main form and is already opened. The user clicks a command [quoted text clipped - 22 lines] DoCmd.OpenForm "FormB" forms!FormB!CommandButtonName.Enabled = False Sure. Forms!FormB!AnyOtherControl.SetFocus Forms!FormB!CommandButton.Enabled = False -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#7
|
|||
|
|||
Disable Command Button
On Sat, 09 Dec 2006 17:44:59 GMT, mdavis via AccessMonster.com wrote:
One more thing. When I close Form B and reopen it the command button is enabled. I would like the command button to be disabled as long as Combo Box B has a value in it. If there isn't a value in the Combo Box than I would like the Command Button to be enabled. Could you please help me with the code for this? Thank you. fredg wrote: Sorry I did not give the proper info. Form B is the main form and is already opened. The user clicks a command [quoted text clipped - 22 lines] DoCmd.OpenForm "FormB" forms!FormB!CommandButtonName.Enabled = False Sure. Forms!FormB!AnyOtherControl.SetFocus Forms!FormB!CommandButton.Enabled = False Code the Form's Current event: Me!CommandButtonName.Enabled = Not IsNull(ComboB) in which case there will most likely be no need to set it from FormA. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#8
|
|||
|
|||
Disable Command Button
This works great.
But now if I delete the record that is in COMBO B how do I make the COMMAND BUTTON enabled so that I can enter another record? fredg wrote: One more thing. When I close Form B and reopen it the command button is enabled. [quoted text clipped - 16 lines] Forms!FormB!AnyOtherControl.SetFocus Forms!FormB!CommandButton.Enabled = False Code the Form's Current event: Me!CommandButtonName.Enabled = Not IsNull(ComboB) in which case there will most likely be no need to set it from FormA. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#9
|
|||
|
|||
Disable Command Button
On Wed, 13 Dec 2006 04:49:16 GMT, mdavis via AccessMonster.com wrote:
This works great. But now if I delete the record that is in COMBO B how do I make the COMMAND BUTTON enabled so that I can enter another record? fredg wrote: One more thing. When I close Form B and reopen it the command button is enabled. [quoted text clipped - 16 lines] Forms!FormB!AnyOtherControl.SetFocus Forms!FormB!CommandButton.Enabled = False Code the Form's Current event: Me!CommandButtonName.Enabled = Not IsNull(ComboB) in which case there will most likely be no need to set it from FormA. Place the same code in the ComboB AfterUpdate event. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#10
|
|||
|
|||
Disable Command Button
The COMMAND BUTTON stays disabled? I can't seem to get it to be enabled
after I delete the record. I probably should've mentioned that the control that you are referring to as "Combo B" is actually an unbound List Box. In order to edit or delete the record in the List Box I click on an EDIT COMMAND BUTTON which opens up another form for me to edit the record or click on a DELETE COMMAND BUTTON to delete the record. Should I be placing the code somewhere else instead of the LIST BOX? I apologize for not supplying you with all of the info. I was trying to keep it as simple as possible. fredg wrote: This works great. But now if I delete the record that is in COMBO B how do I make the COMMAND [quoted text clipped - 10 lines] in which case there will most likely be no need to set it from FormA. Place the same code in the ComboB AfterUpdate event. -- Message posted via http://www.accessmonster.com |
|
Thread Tools | |
Display Modes | |
|
|