Disable/Re-Enable Command button - Programmers Heaven

Howdy, Stranger!

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

Categories

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.