Hi, I am trying to write general function to set the attributes of the command button and want to access this function from any forms.
But I am getting error in this function.
Public Sub SetButtonAttribute(ByRef frm As System.Windows.Forms.Form, ByRef bVal As Boolean)
On Error Resume Next
With frm
' Error Control cmdAdd could not be resolved because it was within the generic namespace Form.
.cmdAdd.Visible = bVal
.cmdEdit.Visible = bVal
End With
End Sub
Please help me
But I am getting error in this function.
Public Sub SetButtonAttribute(ByRef frm As System.Windows.Forms.Form, ByRef bVal As Boolean)
On Error Resume Next
With frm
' Error Control cmdAdd could not be resolved because it was within the generic namespace Form.
.cmdAdd.Visible = bVal
.cmdEdit.Visible = bVal
End With
End Sub
Please help me