I have a field in Event table called EventAttachment. EventAttachment is an Attachment datatype. I want the code to see if it is null and if so put No Attachment in the caption. Sometimes it works and sometimes it doesn’t. For instance, Record 455 has no attachments but it displaying Attachment.
Below is the code:
Does anyone see anything wrong with the code?
Below is the code:
Code:
If IsNull(DLookup("EventAttachment", "Event", "CompanyID = " & Me!txtCompanyID)) Then
Me!cmdAttachments.Caption = "No Attachment"
Me!cmdAttachments.ForeColor = vbRed
Else
Me!cmdAttachments.Caption = "Attachment"
Me!cmdAttachments.ForeColor = -2147483615
End If
Does anyone see anything wrong with the code?