UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> code to determine the correct reference number for a new record    
 
   
RadioactiveFrog
post Sep 19 2007, 01:21 PM
Post #1

UtterAccess Addict
Posts: 195
From: England



Hi All,

I would like to have a form that when a new record is created it works out the next reference number relative to certain details..So i would query the table for all the related records, sort those in order and take the most recent record based on the previous reference number and then + 1.

In theory seems easy..but..how would i do that in a form?

Sorry if that is a really thick question!!

Cheers for any guidance,

Graham.
Go to the top of the page
 
+
Larry Larsen
post Sep 19 2007, 01:44 PM
Post #2

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi
Check out the DMax()..
eg:
=Nz(Dmax("YourFakeNumber","YourTable"),0)+1

HTH's
(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+
RadioactiveFrog
post Sep 27 2007, 01:08 PM
Post #3

UtterAccess Addict
Posts: 195
From: England



Hi Larry,

Just found the reply to this!! So sorry for my late reply! Thanks for the advice, i will give it a go and see how i get on!

Much appreciated,

Graham.
Go to the top of the page
 
+
Larry Larsen
post Sep 27 2007, 01:13 PM
Post #4

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi Graham
NP..

(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 01:52 PM