Conditional VBA If Statement per row

change this portion to:
Code:
Switch(IsNull(TBLALLHRDetails.HRReferenceNumber + TBLALLHRDetails.OCCReferenceNumbers) Or
        TBLALLHRDetails.HRReferenceNumber="N/A" Or
        TBLALLHRDetails.OCCReferenceNumbers = "N/A", Null,
        TBLALLHRDetails.HRReferenceNumber <> TBLALLHRDetails.OCCReferenceNumbers, "Do Not ",
         True, "They ") + "Match" As RefStatus
 
so the "N/A", Null, the null it here is the actual outcome of what will show?
 
Null, the null it here is the actual outcome of what will show?
the output is Null. and Null means "nothing", so you will see blank/nothing.
 
Hi All
I have a Table in a form with multiple fields I am trying to do an IF Statement that if two fields do not Match then the status Text box Box reads "DO NOT MATCH", on after update of the field, I have managed to do it but the issue I am having is that it also updates the other entries, is there a way to do the IF Statement per entry rather than overall?

Obviously Once I have figured this out then I can make Multiple IF statements for what I need but cannot work out why its doing it

Basically I did the top one and showed as THEY MATCH but when I tried the second entry it changed both

Code:
Public Function Func_ReferenceStatus()
    If [Forms]![FRM_TBLALL_Details]![SSFRM_TBLALL_HRDetails].[Form]![TXTHRReferenceNumber] <> _
    [Forms]![FRM_TBLALL_Details]![SSFRM_TBLALL_HRDetails].[Form]![TXTOCCReferenceNumbers]Then

    [Forms]![FRM_TBLALL_Details]![SSFRM_TBLALL_HRDetails].[Form]![TXTReferenceStatus] = "DO NOT MATCH"


Else
     [Forms]![FRM_TBLALL_Details]![SSFRM_TBLALL_HRDetails].[Form]![TXTReferenceStatus] = "THEY MATCH"

End If
End Function

View attachment 106216

This may already have been asked, but why do you get to a situation where you are trying to compare two values like this? It sort of indicates that there is somethnig amiss with the table design.
 

Users who are viewing this thread

Back
Top Bottom