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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Function To Assign Record Number, Access 2010    
 
   
shellp
post May 19 2019, 08:17 AM
Post#1



Posts: 76
Joined: 4-July 11



Hello

I am using Access 2010. I have a db where the main ID number is the client and I want to assign a secondary sequential number (1,2,3 etc.) to the visits per client. The code for the main ID number per client is working well:
QUOTE
Public Function NewCustID() as Long
On Error GoTo NextID_Error
Dim lngNextID as Long
lngNextID=nz(DMax("[ID_Number]","tblClients"))+1
NewCustID=lngNextID
Exit_NewCustID
Exit Function

NextID_Err:
MsgBox "Error " & Err & ": " & Error$
Resume Exit_NewCustID
End Function



Any assistance greatly appreciated. Thanks.
Go to the top of the page
 
 
Start new topic
Replies
theDBguy
post May 19 2019, 09:57 AM
Post#2


Access Wiki and Forums Moderator
Posts: 76,078
Joined: 19-June 07
From: SunnySandyEggo


Do you have a Visit_ID field?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    23rd August 2019 - 05:56 PM