Label Max Value from table

me_ntal

Registered User.
Local time
Today, 23:44
Joined
Jun 22, 2011
Messages
13
Doing an enter form for a table,
I want a label to display the max number in the column it enters into.
 
I don't understand your question?

Do you want to count the records in a form, and display the result in a label? Do you want to total the values in field and place that if a label?
 
...I want a label to display the max number in the column it enters into.
The 'max number' allowed, as defined by you?

The 'max number' as in Maximum Value currently held in that Field in the underlying Table?

Something else?

You have to understand, when posting a question, that those of us trying to help you have no idea of what your needs and goals are, and seldom know about your particular industry/business. We only know what you tell us!

Also, what kind of Form are we talking about? Single View, Continuous View or Datasheet? This is important when speaking of 'labels.'

Linq ;0)>
 
Sorry guys,

I have a table, Different amounts/types of data.

The form im using to input data into it,
Has a label for the user to input a Quote number, I want the default value of textbox to be the Maximum(Highest Number entered)of the column Quote number +1.

As for form its just a standard form so i assume its a single view?
 
If you can only view one Record at a time then yes, it is a Single View Form.

Your question is somewhat confusing. Labels are used for just that, labeling things, usually Controls! You do not enter data through Labels, but through the use of other Controls, such as Textboxes, Comboboxes, Checkboxes and so forth!

Not trying to be nit-picking, but you really need to take a little bit of time to learn the ABCs of Access. Doing so will make it much easier for people to help you.

Some more info needed:
  1. What is the Datatype of the Quote Field, is it Text or Number?
  2. Is this going to be a Single-User or Multi-User app?
  3. Do you want this 'number' to be editable?
All of these things make a difference in the approach you need to use. Generally speaking, though, the Default for the Field could be set, at Form Level to

Code:
=Nz(DMax("[Quote]","QuotationTable")+1,1)
if Quote is defined as a Number Datatype.

if Quote is defined as a Text Datatype the expression would be
Code:
=Nz(DMax("Val([Quote])","QuotationTable")+1,1)

Linq ;0)>
 
Last edited:
Failing to get this to work.

tables name is [Quotes]

Textbox name is [TXT_Quote]
Control Source [R Number]

The forms record source is [Quotes]

I want the default number in the text box to be the highest but also editable, incase we need to skip the quote
 

Users who are viewing this thread

Back
Top Bottom