473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DMAX returns same number

116 100+
I have used the following code before set as the default value on a numeric field and it has always worked. Now it just returns no 1 everytime and i can figure what is different.


=DMax("[thesection]","tbl_sections","[id]=[forms]![frm_jobheader]![urn]")+1


thanks
Christine.
May 30 '10 #1
4 1236
jacc14
116 100+
Ive just realised that it is probably because this is set on a subform which is a continuous form (datasheet). Therefore thesection need requerying?? If i set a requery though the cursor just jumps to the top of the page.
May 30 '10 #2
missinglinq
3,532 Expert 2GB
Where are you trying to set this? If this is Continuous or Datasheet form (they're not the same thing!) and the field Control you're setting this as the Control Source for is Unbound, this is normal behavior. While it may look like X number of controls it is actually X number instances of the same control. The Control would have to be bound for this to work, and I'm not sure that an aggregate function like this would work placed in a Control Source.

Linq ;0)>
May 30 '10 #3
jacc14
116 100+
Hi.

Sorry I should be more clearer. It is a continuous form. I am setting it on a bound text box. It normally works but this is first time i have done it on a continuous form. I cant help but think that its because i need to requery it.

The result i am after is to get a unique number relating to that job starting at 1. I could use autonumber but after thousands of records the figure is too high and I am using it as part of the job number.

thanks
Christine,.
May 30 '10 #4
jacc14
116 100+
@jacc14
Hi All

I have now amended and i force the user to enter as text but have set it so they can't duplicate the entry. Works better as the text has a meaning.


Christine.
May 31 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print the variable as given in the example it returns...
2
by: Piotr Wolski | last post by:
is there any give variavle that returns number of rows of given file?
4
by: JMCN | last post by:
is it possible to insert a value into a field when you append the new records to the table instead of appending the one new record at a time in order to insert a new value? for example, i would...
23
by: Davey | last post by:
How do I display an integer in binary format in C? e.g. 4 displayed as "100"
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
1
by: brad.goldberg | last post by:
2 Part question for you all, seems kinda tricky to me, but many of you are access gods compared to myself. Here's the deal... I have a label on my form called Run Number: Next to it I have a...
1
by: PAF | last post by:
Hi, I'm trying to evaluate a sum expression trougth .NET 2 System.Xml.XPath.XPathNavigator object. My code is : Dim document As New System.Xml.XmlDocument() document.LoadXml("<?xml...
12
by: Andrus | last post by:
I need to create function static int ItemNumber(string itemName) which returns number from end of name ItemNumber("Item1") returns 1 ItemNumber("Other1") returns 1...
1
by: nrtyme | last post by:
Hello, I need to add several new records to Table2 from Table1. Table2 contains a field called that needs to be the previous maximum value of incremented by 1. Below is my code but i keep...
2
by: ems9tech | last post by:
I can't get this count to return a number without an empty quote at the end ( " ) or getting NaN. Does anyone know why? I've searched and don't see any other postings on this issue. I'm using VS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.