AlexandreAmant
IS-IT--Management
Hi !
I am building an accounting DB and the debit/credit field is giving me a problem in a query: I have a combo and the user can choose between debit, credit and both. When the user selects debit or credit, the query filters accordingly, but when the user chooses both, the query should return both results.
I try to put this the query criteria for debitcredit:
Switch([Forms]![F_AccountBalance]![ComboDebitCredit] = "Debit", "Debit", [Forms]![F_AccountBalance]![ComboDebitCredit] = "Credit", "Credit", [Forms]![F_AccountBalance]![ComboDebitCredit] = "Both", "Debit" & """ Or """ & "Credit"
But it does not work when "Both" is selected and I can't see what's wrong.
I've tried also to put the null value or a zero-lenght string but everytime the query returns nothing when "Both" is selected.
Any idea ?
Thanks !
@lex
I am building an accounting DB and the debit/credit field is giving me a problem in a query: I have a combo and the user can choose between debit, credit and both. When the user selects debit or credit, the query filters accordingly, but when the user chooses both, the query should return both results.
I try to put this the query criteria for debitcredit:
Switch([Forms]![F_AccountBalance]![ComboDebitCredit] = "Debit", "Debit", [Forms]![F_AccountBalance]![ComboDebitCredit] = "Credit", "Credit", [Forms]![F_AccountBalance]![ComboDebitCredit] = "Both", "Debit" & """ Or """ & "Credit"
But it does not work when "Both" is selected and I can't see what's wrong.
I've tried also to put the null value or a zero-lenght string but everytime the query returns nothing when "Both" is selected.
Any idea ?
Thanks !
@lex