Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Disable/Re-Enable Command button

BigPete85BigPete85 Posts: 30Member
I have a command button that add's records the database then gets disabled and enableds the "Are you sure you want to save" command button. The problem is i when i then click the "are u sure you wan to save" button i want it to disable itself and re-enabled the Add button. But access tells me something like "Unable to (something) because the control has focus" and it will not re-enable itself again. Is this problem easily fixed?

Comments

  • dokken2dokken2 Posts: 532Member
    : I have a command button that add's records the database then gets disabled and enableds the "Are you sure you want to save" command button. The problem is i when i then click the "are u sure you wan to save" button i want it to disable itself and re-enabled the Add button. But access tells me something like "Unable to (something) because the control has focus" and it will not re-enable itself again. Is this problem easily fixed?
    :

    You need to move the focus to another control like a button or textbox and then disable the button-

    [code]
    Private Sub Command5_Click()
    Me.Command4.SetFocus
    'Me.textbox1.SetFocus
    Me.Command5.Enabled = False
    End Sub
    [/code]
Sign In or Register to comment.