Default form date same as last entry....

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
 
T

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
 
M

MacDermott

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?




.
 
T

Trevor

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


.


.
 

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