Something new in access 2010? (1 Viewer)

rainman89

I cant find the any key..
Local time
Yesterday, 20:39
Joined
Feb 12, 2007
Messages
3,015
Does anyone know why access 2010 would not be able to handle this where statement?

WHERE ((([dbo_Calendar].[endYear])=IIf(Month(Now())>=7,((Year(Now())+1)),((Year(Now()))))))

I get a compile error . in query expression, but 2007 handles it just fine!
 

namliam

The Mailman - AWF VIP
Local time
Today, 02:39
Joined
Aug 11, 2003
Messages
11,695
Though the brackets seem to be in the 'right place' boy wow a lot of brackets...

And though not a real answer, try this without an IIF:
Year(date() ) + abs(Month(Date()) > 6)
 

rainman89

I cant find the any key..
Local time
Yesterday, 20:39
Joined
Feb 12, 2007
Messages
3,015
Though the brackets seem to be in the 'right place' boy wow a lot of brackets...

Yeah I probably could have cleaned it up alittle bit..... sorry about that.

And though not a real answer, try this without an IIF:
Year(date() ) + abs(Month(Date()) > 6)

When I try this I get

"There was an error compiling this function. The visual basic module contains a syntax error."

Then It highlights "Year"
 

Banana

split with a cherry atop.
Local time
Yesterday, 17:39
Joined
Sep 1, 2005
Messages
6,318
Check Tools -> References in the VBA editor. Do you have any missing reference? This sounds like a case of something AWOL...
 

rainman89

I cant find the any key..
Local time
Yesterday, 20:39
Joined
Feb 12, 2007
Messages
3,015
I have the following, I'm not sure I see anything missing...
VB for Applications
Access 14.0 object library
OLE Automation
Microsoft Activex
Office 14.0 access database engine object library
 

boblarson

Smeghead
Local time
Yesterday, 17:39
Joined
Jan 12, 2001
Messages
32,059
This one:
Office 14.0 access database engine object library

is the new DAO and you might try unchecking it, closing things and then reopening and checking it again (if it will even let you uncheck it, which I don't know if that is possible).
 

rainman89

I cant find the any key..
Local time
Yesterday, 20:39
Joined
Feb 12, 2007
Messages
3,015
Unchecking it didn't seem to work... and I can't uncheck them all because some are in use.
 

boblarson

Smeghead
Local time
Yesterday, 17:39
Joined
Jan 12, 2001
Messages
32,059
Well, have you tried importing everything into a new, blank database shell?
 

rainman89

I cant find the any key..
Local time
Yesterday, 20:39
Joined
Feb 12, 2007
Messages
3,015
Just did, from a 2000 format to a 2007 format and now the query works...

I'm curious as to why It wont work as is, seeing as in access 2007 it works just fine...
 

boblarson

Smeghead
Local time
Yesterday, 17:39
Joined
Jan 12, 2001
Messages
32,059
Hard to say - sometimes things just seem to hit a snag.
 

Users who are viewing this thread

Top Bottom