Hello,
Is there a way to remove the focus from a command button after the button has been clicked? I have a Form-A with a Button-B that only becomes visible is certain conditions exist. Button-B opens a second Form-B for additional input (Form-A is still open). Once Form-B is closed, I want Button-B on the Form-A to disappear.
I have this working as a “test button” on Form-A where if I click the Test button, it closes Button-B as I want. I tried setting my Test code on the OnLostFocus property of Button-B but it tells me I can’t close a control that has the focus.
TEST CODE:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RepaintObject
If Me.Grades = -1 Then
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Else
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Me.cmdGrdRequest.Visible = False
End If
Any suggestions would be greatly appreciated.
Thanks,
SKK
Is there a way to remove the focus from a command button after the button has been clicked? I have a Form-A with a Button-B that only becomes visible is certain conditions exist. Button-B opens a second Form-B for additional input (Form-A is still open). Once Form-B is closed, I want Button-B on the Form-A to disappear.
I have this working as a “test button” on Form-A where if I click the Test button, it closes Button-B as I want. I tried setting my Test code on the OnLostFocus property of Button-B but it tells me I can’t close a control that has the focus.
TEST CODE:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RepaintObject
If Me.Grades = -1 Then
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Else
If Me.Request_No > 0 Then
Me.txtRequest_No.Visible = True
Me.cmdGrdRequest.Visible = False
Else
Me.txtRequest_No.Visible = False
Me.cmdGrdRequest.Visible = True
End If
Me.cmdGrdRequest.Visible = False
End If
Any suggestions would be greatly appreciated.
Thanks,
SKK