Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Dec 19, 2022

DCount

Hello Experts,

 

I am wanting to check if a table [Import_Excel_FBL1N] has a match on [InvNo].  I am not sure if Dcount is the best way to do this?   

 

Import_Excel_FBL1N.Reference = TEXT

InvNo = TEXT

 

It sometimes returns a #Error which leads me to believe I am doing something wrong or if I need an Nz check possibly? 

 

=IIf(DCount("*","Import_Excel_FBL1N","[Reference] =" & [InvNo])>0,"Yes","No")

 

I hope it makes sense.  Any questions please let me know.  

 

  • If InvNo is text, you need to wrap it in single-quotes:
    =IIf(DCount("*","Import_Excel_FBL1N","[Reference] ='" & [InvNo] & "'")>0,"Yes","No")
  • If InvNo is text, you need to wrap it in single-quotes:
    =IIf(DCount("*","Import_Excel_FBL1N","[Reference] ='" & [InvNo] & "'")>0,"Yes","No")
    • Tony2021's avatar
      Tony2021
      Steel Contributor
      ahh yes. the text quotes. I forget about this too often. thank you. It works now.

Resources