Compile error after DB Split in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I created some test DB's for test data by copying and relinking the FE and
BE of an existing DB that is having problems. My queries are giving me
a"compile error" when I try to open them. The error is in the Criteria which
is just a date expression
=DateAdd("d",-3,Date()) And <=Date()+1. If I enter this expression in design veiw, when I reopen the query in design view again, I get the error and the criteria is gone.
What can I do to get this test DB going?

Thanks
 
I added DAO 3.6 to my libraery, closed the DB and reopened it and I still get
the compile messages. In fact I get one for every query in the database
before it opens. I have to click OK to get to the next error message. They
all have date expressions???????
 
Also, after I click through all the "compile" statements, I get another error
Visual Basic module contains a syntax error. there was an error compiling
this function
Help!
 
Okay, so you have code in the database that does not compile.

You need to fix the code. When it refuses to compile, it will point out the
line that cannot be understood. Fix it, and repeat until the database
compiles okay.
 
Here is the message. I don't understand how to fix it.
Compile error. in query expression '((([Weekly Contractor
Injuries].WeekEndDate)>=(DateAdd("d",-3,Date()) and (Wkly Contatctor
Injuries].WeekEndDate)<=Date()+1))'
When I use Alt-F11 to find any code, the lnly objects listed are forms and
subforms, no queries.
Thanks for looking at this.
 
Here is the message. I don't understand how to fix it.
Compile error. in query expression '((([Weekly Contractor
Injuries].WeekEndDate)>=(DateAdd("d",-3,Date()) and (Wkly Contatctor <<<--
Injuries].WeekEndDate)<=Date()+1))'
When I use Alt-F11 to find any code, the lnly objects listed are forms and
subforms, no queries.
Thanks for looking at this.

You're missing an opening square bracket and have misspelled Contractor on the
marked line.


John W. Vinson [MVP]
 
I am a lousy typer, I tried to do a paste and copy and couldn't.
Do you see any other reason why this statement would not make a connection
between the query and the combo box on the form?

John W. Vinson said:
Here is the message. I don't understand how to fix it.
Compile error. in query expression '((([Weekly Contractor
Injuries].WeekEndDate)>=(DateAdd("d",-3,Date()) and (Wkly Contatctor <<<--
Injuries].WeekEndDate)<=Date()+1))'
When I use Alt-F11 to find any code, the lnly objects listed are forms and
subforms, no queries.
Thanks for looking at this.

You're missing an opening square bracket and have misspelled Contractor on the
marked line.


John W. Vinson [MVP]
 
I am a lousy typer, I tried to do a paste and copy and couldn't.
Do you see any other reason why this statement would not make a connection
between the query and the combo box on the form?

Your statement doesn't make any reference to any form!

The syntax to do so is

[Forms]![NameOfTheForm]![NameOfTheControl]

and the brackets are required. Just naming a control in a Query will not work,
because the Query has no indication what forms are meant - there might be
several forms open, or none at all.

John W. Vinson [MVP]
 

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

Back
Top