473,471 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Incremental Numbering

1 New Member
I am computerizing service tickets - I would like to create an incremental number as one of the fields. In addition I need to be able to set the starting value of the number

Scott
Oct 26 '06 #1
5 1622
MMcCarthy
14,534 Recognized Expert Moderator MVP
I am computerizing service tickets - I would like to create an incremental number as one of the fields. In addition I need to be able to set the starting value of the number

Scott
This would have to be set programmatically behind the data entry form probably in the On Current event.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim tempNum As Integer
  3.  
  4. tempNum=DMax("[ServiceID]","[TableName]")
  5.  
  6. If tempNum=0 or IsNull(tempNum) Then
  7.     Me.ServiceID = 1 ' or whatever number you want
  8. Else
  9.     Me.ServiceID = tempNum + 1
  10. End If
  11.  
  12.  
Oct 26 '06 #2
Killer42
8,435 Recognized Expert Expert
Would IsNull work on an Integer?
Oct 26 '06 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Good spot Killer
Try this (plagiarised shamelessly from MMcCarthy's post)

Expand|Select|Wrap|Line Numbers
  1. 'Any number here to start the count (at conBase + 1)
  2. Private Const conBase As Integer = 0
  3.  
  4. Me.ServiceID = Nz(DMax("[ServiceID]", "[TableName]"), conBase) + 1
Oct 26 '06 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thanks guys.

I'm always doing stupid things like that. Feel free to correct any time.


Good spot Killer
Try this (plagiarised shamelessly from MMcCarthy's post)

Expand|Select|Wrap|Line Numbers
  1. 'Any number here to start the count (at conBase + 1)
  2. Private Const conBase As Integer = 0
  3.  
  4. Me.ServiceID = Nz(DMax("[ServiceID]", "[TableName]"), conBase) + 1
Oct 26 '06 #5
NeoPa
32,556 Recognized Expert Moderator MVP
Don't think of it like that M.
I always feel extra pleased if I can improve on something you've posted, and that's because of the reputation you've earned for high-quality work.
Oct 26 '06 #6

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

Similar topics

5
by: Bangalore | last post by:
Hi In reversing string usring recursive function, i found problems in using incremental postfix , and incremental prefix 1 void rev(char*); 2 void main() 3 { 4 char s="STRING"; 5 ...
1
by: jane | last post by:
HI, I had a question on incremental backup. We had an incremental backup every weekend. We did full backup every other week. That is one week incremental + full , the other week is...
1
by: Jimmy Chen | last post by:
Recently I've done a db2 backup and restore/recovery, but the process for recovering the database was different than what I thought to be. here is what I did: DB2 is set in online mode -...
3
by: apple | last post by:
UDB v8 fp 6a on AIX 5.1.0.0 Below is a manual incremental recover from compressed backup datasets. With external compress backup datasets, can it be coded to do an automatic incremental recover?...
0
by: Willem | last post by:
Based on MK's TSI_SOON (http://www.trigeminal.com/)I've created a nifty little procedure that - whenever you compact you db you get an incremental backup copy. Given that you have a table with...
6
by: Rudy Ray Moore | last post by:
I work with a multi-project workspace. One project (the "startup" project) has a "Configuration Type" of "Application (.exe)". The other 40 projects have a "Configuration Type" of "Static Library...
3
by: Alex Shturm | last post by:
Hi, I am trying to activate incremental link using VC7 (.NET 2003) on a pretty big project (executable size is more than 100Mb, and it gets linked from several dozen of libraries and object...
8
by: Bern McCarty | last post by:
We have a large mixed dll that I can never seem to get to link incrementally. Below is the console output. For simplicity I've eliminated some stuff that we normally do when we really link this...
17
by: angi35 | last post by:
Hi - I'm working in Access 2000. I've got a strange numbering system for work orders, and I'm wondering if, nonetheless, there's a way to get Access to assign the next incremental number for a new...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.