accessrookie2
Registered User.
- Local time
- Today, 07:47
- Joined
- Jul 23, 2009
- Messages
- 16
This is driving me crazy, this works the way I want it too:
Nz(DCount([zColumnNumber], "ExcelTable", "F3 = '" & zNumber & "'"), 0)
I want it to count the times that records under column F3 are equal to zNumber which despite the name is actually a string. Now here is my issue. Sometimes the column name won't be F3, but rather F2 or F4 so I need to use a variable called zColumnNumber. I tried this code:
Nz(DCount([zColumnNumber], "ExcelTable", [zColumnNumber] = "'" & zNumber & "'"),0)
But everytime that comes up as 0 even if it should come up as 1. zColumnNumber's value is currently set to "F3" so I don't understand the difference in the code.
If I try something like:
Nz(DCount([zColumnNumber], "ExcelTable", "[zColumnNumber] = '" & zNumber & "'"),0)
I then get the error: "You canceled the previous operation"
Please let me know what I can do to fix this problem.
Thanks!
Nz(DCount([zColumnNumber], "ExcelTable", "F3 = '" & zNumber & "'"), 0)
I want it to count the times that records under column F3 are equal to zNumber which despite the name is actually a string. Now here is my issue. Sometimes the column name won't be F3, but rather F2 or F4 so I need to use a variable called zColumnNumber. I tried this code:
Nz(DCount([zColumnNumber], "ExcelTable", [zColumnNumber] = "'" & zNumber & "'"),0)
But everytime that comes up as 0 even if it should come up as 1. zColumnNumber's value is currently set to "F3" so I don't understand the difference in the code.
If I try something like:
Nz(DCount([zColumnNumber], "ExcelTable", "[zColumnNumber] = '" & zNumber & "'"),0)
I then get the error: "You canceled the previous operation"
Please let me know what I can do to fix this problem.
Thanks!