I have vba code that runs when a form opens. It checks how many records are included in the form. If there is 0, then is does something specific. The problem is that the code isn't executing. There is the code:
When there are 0 records, it displays the "hi" message box so I know its going into the If statement, but doesn't seem to execute the code after that. There are two buttons that are overlapped. It is supposed to hide one button and unhide another.
Code:
Private Sub Form_Open(Cancel As Integer)
MsgBox Me.RecordsetClone.RecordCount
If Me.RecordsetClone.RecordCount < 1 Then
MsgBox "hi"
Me.RemovedPN.SetFocus
Me.buttonnew.Visible = False
Me.ButtonClose.Visible = True
If IsFormLoaded("repairdata") Then
Me.RepairDataID = Forms!repairdata.RepairID
End If
End If
End Sub