![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have come across an odd problem in A2007. I have a small form with a combo in it that I use to display a month from a query that shows all 12 months in order. In a bit of code in the After Update event I used Month(Date) for something (this is carried over from the earlier A2003 version - which worked fine - that has been upgraded to A2007). The code throws an error and I tried for ages (well, an hour maybe) to find the problem. It turns out that Month(CDate(Date)) works fine while Month(Date) does not. I have no idea why and am not going to waste my time chasing reasons. I just hope this info might save someone else the frustration I had to undergo ... JB ps If I'm being dense here please be gentle ... |
#3
| |||
| |||
|
|
On Wed, 31 Mar 2010 09:10:54 -0700 (PDT), jbguernsey j... (AT) angelsystems (DOT) co.uk> wrote: Just checking your (my?) density level: is "Date" the name of your combobox? -Tom. Microsoft Access MVP I have come across an odd problem in A2007. *I have a small form with a combo in it that I use to display a month from a query that shows all 12 months in order. *In a bit of code in the After Update event I used Month(Date) for something (this is carried over from the earlier A2003 version - which worked fine - that has been upgraded to A2007). The code throws an error and I tried for ages (well, an hour maybe) to find the problem. *It turns out that Month(CDate(Date)) works fine while Month(Date) does not. *I have no idea why and am not going to waste my time chasing reasons. *I just hope this info might save someone else the frustration I had to undergo ... JB ps *If I'm being dense here please be gentle ... |
#4
| |||
| |||
|
|
On Apr 1, 5:36*am, Tom van Stiphout <tom7744.no.s... (AT) cox (DOT) net> wrote: On Wed, 31 Mar 2010 09:10:54 -0700 (PDT), jbguernsey j... (AT) angelsystems (DOT) co.uk> wrote: Just checking your (my?) density level: is "Date" the name of your combobox? -Tom. Microsoft Access MVP I have come across an odd problem in A2007. *I have a small form with a combo in it that I use to display a month from a query that shows all 12 months in order. *In a bit of code in the After Update event I used Month(Date) for something (this is carried over from the earlier A2003 version - which worked fine - that has been upgraded to A2007). The code throws an error and I tried for ages (well, an hour maybe) to find the problem. *It turns out that Month(CDate(Date)) works fine while Month(Date) does not. *I have no idea why and am not going to waste my time chasing reasons. *I just hope this info might save someone else the frustration I had to undergo ... JB ps *If I'm being dense here please be gentle ... Hi Tom No, I learned a sad lesson about reserved words many years ago! The thing about this oddity is, the bit of code is in a Form Module and won't work there - even msgbox Month(Date) throws an error whereas if I put it into a function in a Code Module it's fine. There are no References problems I can find and I've decompiled as well. Go figure ... JB |
![]() |
| Thread Tools | |
| Display Modes | |
| |