Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show MAX() value in Entry Form 1

Status
Not open for further replies.

storyboy

Programmer
Sep 16, 2004
25
US
Being a newbie, some of this is so logical, so easy, and other things so complicated, I am missing something,
DATA ENTRY Form.
unbound text field and I want it to show the highext value in the current file. Form is connected to file, HIH and in that file is field VCNO so on control source property I have,
=MAX([VCNO])

I don't get an error, just nothing shows in the field. I have this same thing on same form that views the records in the file HIH and it shows the highest value of that field.
The only difference in the two forms is that one is open for DATA ENTRY.
My intent here is to get the highest value for this field so I know what the next invoice number should be. Seems simple enough but I am missing something. Please help, and thank you in advance, I did check many many screens of previous questions and answers, hours of it. Now I ask for help.
 
Syntax if you are reading the value stored on the table...
=DMax("[FieldName]), "YourTableName", "OptionalYourWhereClause")

For example
- tblInvoice - name of invoice table
- no WHERE clause

=DMax("[VCNO]), "tblInvoice")

...Having said that
My intent here is to get the highest value for this field so I know what the next invoice number should be

If you are using AutoNumber, and are looking for a sequential numering, you may be in for some frustation. The Autonumber will generate for OnInsert which means when ever data entry starts for a new record.


Some things to read...
Start Autonumber Id to begin at 1706!
Why AutoNumber shouldn't be used in MultiUser databases (And How to ge the Unique Number) faq700-184

If you are using your own number system, then fine.

Richard
 
Not using autonumber, have simple numbering system that they had in use for quite some time. I get involved with converting clipper programs to Access. Pushing data and everything else, like new programs, screens the whole lot. I enjoy it a lot but some times Access stumps me because I am so new at it. Thank you so very much. You know your stuff and I wish I were you for that.
Tom the Storyboy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top