473,289 Members | 2,141 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,289 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 1233
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.