I have a continuous subform that lists all the Memo's associated with a particular Company (specified on the main form). Each Company can have many Memo's.
Next to each Memo record on the subform, I have a comand button (btnMemoPopup) that opens a new form (popup and modal), showing all of the details associated with each Memo. So, if I have 10 Memo's for a prticular company, there will be 10 btn's. This works fine.
However, the btnMemoPopup appears (just once) in the subform, even if a particular company has no memo's. So I thought that I would hide the btnMemoPoup, unless there were more than 0 records. I created a txtCountRecords control in the heading of the subform that counts how many memo records there are. I then inserted the following code on the "On Open" event of the form:
If txtCountRecords = 0 Then
btnMemoPopup.Visible = False
Else: btnMemoPopup.Visible = True
End If
However, the btnMemoPopup stays hidden even if the count > 0.
Any ideas much appreciated.
Next to each Memo record on the subform, I have a comand button (btnMemoPopup) that opens a new form (popup and modal), showing all of the details associated with each Memo. So, if I have 10 Memo's for a prticular company, there will be 10 btn's. This works fine.
However, the btnMemoPopup appears (just once) in the subform, even if a particular company has no memo's. So I thought that I would hide the btnMemoPoup, unless there were more than 0 records. I created a txtCountRecords control in the heading of the subform that counts how many memo records there are. I then inserted the following code on the "On Open" event of the form:
If txtCountRecords = 0 Then
btnMemoPopup.Visible = False
Else: btnMemoPopup.Visible = True
End If
However, the btnMemoPopup stays hidden even if the count > 0.
Any ideas much appreciated.