stupid error message

G

Guest

I am getting an #ERROR when I have
=Max([Usage Data]![Date])in one of the text boxes on a
form.


The table "Usage Data" exists and so does "Date" field...I
have also tried changing Date to Use date etc...

Need help ...
 
M

Max Smart

A couple things come to mind. 'Date' is an Access function, so I think you
should give it a different name (likeMyDate or something). Also, if the
textbox is bound to a table field, try changing the name of the textbox
where you're storing the date - I've had trouble when the textbox has the
same name as the Control Source (which Access does by default).

Max
 
F

fredg

I am getting an #ERROR when I have
=Max([Usage Data]![Date])in one of the text boxes on a
form.

The table "Usage Data" exists and so does "Date" field...I
have also tried changing Date to Use date etc...

Need help ...

1) Date is an Access/VBA reserved word and should not be used as a
field name. Change [Date] to dteDate, ADate, WhateverDate, etc.

2) If the [DateField] is included in the form's record source, change
the expression to:
=Max([DateField])

3) If [DateField] is NOT included in the form's record source then
you can use DMax() to get the value from the table.
=DMax("[DateField]","[Usage Data]")

4) Make sure the name of the control is not the same as the name of
the field used in the expression.
 
M

Marshall Barton

I am getting an #ERROR when I have
=Max([Usage Data]![Date])in one of the text boxes on a
form.


The table "Usage Data" exists and so does "Date" field...I
have also tried changing Date to Use date etc...


I think there may be two issues here. You must refer to
field in the form's record source table/query (not a control
on the form). Another possible issue it that you can not
have a control on the form with thesame name as the field.

The use of a field named date will eventually be an issue if
it isn't already causing trouble.

Try this using just =Max(UseDate) (after you change the name
of the field in the table).
 

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