Solved Getting 0 (zero) for any Value in the Member_FK filed

sbaud2003

Member
Local time
Tomorrow, 03:09
Joined
Apr 5, 2020
Messages
184
Txtissued.Value= DCount ("[LOAN_ID]", "[LOAN]", [Member_FK] = "Forms!FrmLoan!Member_FK" & " AND (Date_Returned) is Null")


can any one explain
 
Maybe try,
Code:
Txtissued.Value= DCount ("[LOAN_ID]", "[LOAN]", "[Member_FK] = " & Forms!FrmLoan!Member_FK & " AND (Date_Returned) is Null")
 
Maybe try,
Code:
Txtissued.Value= DCount ("[LOAN_ID]", "[LOAN]", "[Member_FK] = " & Forms!FrmLoan!Member_FK & " AND (Date_Returned) is Null")
datatype mismatch error is coming
 
datatype mismatch error is coming
Then maybe try:
Code:
Txtissued.Value= DCount ("[LOAN_ID]", "[LOAN]", "[Member_FK] = '" & Forms!FrmLoan!Member_FK & "' AND (Date_Returned) is Null")
 
When a DCount finds nothing, it returns zero. Therefore, your criteria statement must have been incorrectly formed. DBG showed you a way that should work, but for future reference, it is always a good idea to try to write a test query (using a constant rather than a form reference) to see if anything exists to match your criteria. That makes it easier to then build the DCount statement.
 
T
DCount ("[LOAN_ID]", "[LOAN]", "[Member_FK] = '" & Forms!FrmLoan!Member_FK & "' AND (Date_Returned) is Null")
Thank you so much;;;;;
its working fine
I am really happy to be the member of This gruop
Thanks DBG
 
T

Thank you so much;;;;;
its working fine
I am really happy to be the member of This gruop
Thanks DBG
Hi. You're welcome. Doc and I were happy to assist. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom