Default form date same as last entry....

  • Thread starter Thread starter Trevor
  • Start date Start date
T

Trevor

Hello All,

I have a form which is used to enter invoice data. I
wanted to have the date field on the form default to
whatever date was used for the last entry. I set up a
query that finds the last record in the table and returns
to me the date associated with that entry. The query
works fine and returns what I want when run on its own.
However, when I set the default value property of the
textbox on the form to the result of that query, the form
field simply shows "#Name?". Any ideas as to what I am
doing wrong?

Any help is much appreciated. Thanks.

Trevor
 
=[LastDate]![OrderDate]

LastDate is the name of the query and OrderDate is the
field returned by the query. The query returns only one
record, as it should. But it does not display this date
in the form.

Thanks,

Trevor
 
Try this:
=DLookup("OrderDate","LastDate")

HTH
- Turtle


Trevor said:
=[LastDate]![OrderDate]

LastDate is the name of the query and OrderDate is the
field returned by the query. The query returns only one
record, as it should. But it does not display this date
in the form.

Thanks,

Trevor

-----Original Message-----
What is the code you use to set the DefaultValue property?




.
 
Thank you much. We have been puzzled by that for two
days. I appreciate it.

Trevor
-----Original Message-----
Try this:
=DLookup("OrderDate","LastDate")

HTH
- Turtle


=[LastDate]![OrderDate]

LastDate is the name of the query and OrderDate is the
field returned by the query. The query returns only one
record, as it should. But it does not display this date
in the form.

Thanks,

Trevor

-----Original Message-----
What is the code you use to set the DefaultValue property?

Hello All,

I have a form which is used to enter invoice data. I
wanted to have the date field on the form default to
whatever date was used for the last entry. I set up a
query that finds the last record in the table and returns
to me the date associated with that entry. The query
works fine and returns what I want when run on its own.
However, when I set the default value property of the
textbox on the form to the result of that query, the form
field simply shows "#Name?". Any ideas as to what I am
doing wrong?

Any help is much appreciated. Thanks.

Trevor


.


.
 
Back
Top