Thank you all for you input on this. I'm was able to get it work.
Now if there's more than one button to be hidden, would I do this or is there another way?
Buttons Me, "a1", False
Buttons Me, "a2", False
Buttons Me, "a3", False
Code:
Private Sub cmdSQL_Click()
RunUpdate Me.CustomerID
Buttons Me, "a1", False
Forms!CustomerF.Refresh
End Sub
Private Sub cmdSQL_Click()
RunUpdate Me.CustomerID
Buttons Me, "a1", False
Forms!CustomerT.Refresh
End Sub
Option Compare Database
Public Sub RunUpdate(ByVal Cid)
Dim A As String
DoCmd.SetWarnings False
A = "UPDATE CustomerT Set CustomerT.IsActive = true " _
& "WHERE CustomerT.CustomerID=" & Cid & ""
DoCmd.RunSQL A
DoCmd.SetWarnings True
End Sub
Public Sub Buttons(ByRef frm As Access.Form, strCtlName As String, ynStatus As Boolean)
frm.Controls(strCtlName).Transparent = Not ynStatus
frm.Controls(strCtlName).Enabled = ynStatus
End Sub
Now if there's more than one button to be hidden, would I do this or is there another way?
Buttons Me, "a1", False
Buttons Me, "a2", False
Buttons Me, "a3", False