What the heck is a "compile error"?

G

Guest

When I add a find button (binoculars) to my form & then try to use it in form
view, a visual basic window opens up. (Editor's note - I am intimidated by
visual basic.) The error message displayed says: COUNT ([#CyclesChemo]) FROM
[tblPatients] WHERE ([#CyclesChemo] =NotNull;

What does this mean?
 
A

Arvin Meyer [MVP]

Are you sure it doesn't say:

SELECT COUNT ([#CyclesChemo]) FROM [tblPatients] WHERE ([#CyclesChemo]
=NotNull;

If not, try changing it to the above. The code is counting the number of
instances of chemo-therapy cycles in the patient's table where that field
has a value.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
D

Douglas J Steele

Shouldn't that be

SELECT COUNT ([#CyclesChemo]) FROM [tblPatients] WHERE ([#CyclesChemo] Is
Not Null;

?

And in actual fact, the WHERE clause shouldn't be required. From the Help
file:

"The Count function doesn't count records that have Null fields unless expr
is the asterisk (*) wildcard character. If you use an asterisk, Count
calculates the total number of records, including those that contain Null
fields."

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Arvin Meyer said:
Are you sure it doesn't say:

SELECT COUNT ([#CyclesChemo]) FROM [tblPatients] WHERE ([#CyclesChemo]
=NotNull;

If not, try changing it to the above. The code is counting the number of
instances of chemo-therapy cycles in the patient's table where that field
has a value.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access


NC_Sue said:
When I add a find button (binoculars) to my form & then try to use it in form
view, a visual basic window opens up. (Editor's note - I am intimidated by
visual basic.) The error message displayed says: COUNT ([#CyclesChemo]) FROM
[tblPatients] WHERE ([#CyclesChemo] =NotNull;

What does this mean?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top