A family of Microsoft relational database management systems designed for ease of use.
Try this:
Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.RecordCount = 0 Then
Me.cmd1.Visible = True
Else
Me.cmd1.Visible = False
End If
End Sub
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I need help in writing a VBA code to hide a button on a form if there are already records on the forms. This is to prevent users from accidentally clicking twice. To make btnStart invisible if there are records already on frmTest and visible if there are no records on the form.
FrmTest
btnStart
Thank u in advance.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Try this:
Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.RecordCount = 0 Then
Me.cmd1.Visible = True
Else
Me.cmd1.Visible = False
End If
End Sub