Format Date bug ??

I

ianc

I'm using Access 2007 and appear to have a discovered a bug can anyone shed
any light?

I have a form with a datasource and have a simple piece of code that formats
a date to give me the week number of the current week:

format(Date, "ww", 2)

When I run the code I get an error message 13 Type Mismatch. The value is
not assigned to a field and the message even appears when I display the
result in a message box. However when I remove the data source for the form
the error disappears and the correct value is displayed.

Thanks in advance

Ian
 
I

ianc

2 minutes later and solved my own problem. It occurred to me that I might
have a reserved word as a field name in the data source and bingo I've called
one of the fields in the datasource "format" duh.

Helps to talk though!
 
S

Stuart McCall

ianc said:
I'm using Access 2007 and appear to have a discovered a bug can anyone
shed
any light?

I have a form with a datasource and have a simple piece of code that
formats
a date to give me the week number of the current week:

format(Date, "ww", 2)

When I run the code I get an error message 13 Type Mismatch. The value is
not assigned to a field and the message even appears when I display the
result in a message box. However when I remove the data source for the
form
the error disappears and the correct value is displayed.

Thanks in advance

Ian

This is a guess: Sounds like you have a field called 'Date' in the
recordsource. If so, change the name to eg OrderDate.
 

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