VBA code problem

fadetoblack

Registered User.
Local time
Today, 00:53
Joined
Aug 26, 2006
Messages
16
Hi,

I've created a button through the wizard but when I click it, this comes up:


"compile error"

Option Compare Database

SELECT
FROM Query([Litters per year])
WHERE Month = [date?]

i've tried deleting both the code and the button,but the complie error just comes back.
 
You can't just type SQL into VBA. Use the query builder to create a query. You can then run it. Also, your select statement is not syntactically valid.
 
I don't know much about SQL or VB.

What I wanted to know is how to get rid of that code. Its stopping me putting any commant buttons on my form.

Everytime I click them that comes up. Its not even a query i'm using or even have anymore.

thanks
 
even when I create a new form and put command buttons on. that error still comes up. I don't know how to get rid of it.
 
Can't you just go to where that code is and delete it?
 
Here's a brand new version, enjoy.

PS had to remove the picture in your form in order to upload the file

RV
 

Attachments

The "bad" code is in you reports not the form.
Open up one of your reports in design view and then push Alt+F11 and delete all the code behind the reports.
 
ansentry said:
The "bad" code is in you reports not the form

Indeed, forgot to mention that in my previous reply.
Code was removed from all reports as per the sample.
Reports and queries where replaced by one report plus one query.
Added a new form that enables you to generate a report per month, per year and for all years.

Rv
 

Users who are viewing this thread

Back
Top Bottom