473,473 Members | 4,204 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Generating Numbers

I am creating a certain program and in that program i want to add a
field which will be creating numbers with text in sequence older "
Like MPL 001/08 to unlimited " And 08 be current year. This will only
be possible if that field is enebled, if the condition of enebling
this field still is false then the field returns the previous value
that is it maintances the previous record number.

please assist as soon as possible
Aug 11 '08 #1
3 1285
On Aug 11, 8:43*am, mphil.s...@gmail.com wrote:
I am creating a certain program and in that program i want to add a
field which will be creating numbers with text in sequence older "
Like MPL 001/08 *to unlimited " And 08 be current year. This will only
be possible if that field is enebled, if the condition of enebling
this field still is false then the field returns the previous value
that is it maintances the previous record number.

please assist as soon as possible
I'd start by creating that field on the fly from 3 fields... rather
than storing that field as a single value.

What I mean is, have 3 fields.
TypeText
Counter
CurrentYear

Display of these values would then be:
[TypeText] & " " & format([Counter],"000") & "/" & [CurrentYear]

Then, you can apply logic on the values in the various fields.

You'll have to ask the question differently to get help with applying
the logic.

Jon
Aug 11 '08 #2
On Aug 11, 10:24*pm, jonceramic <joncera...@gmail.comwrote:
On Aug 11, 8:43*am, mphil.s...@gmail.com wrote:
I am creating a certain program and in that program i want to add a
field which will be creating numbers with text in sequence older "
Like MPL 001/08 *to unlimited " And 08 be current year. This will only
be possible if that field is enebled, if the condition of enebling
this field still is false then the field returns the previous value
that is it maintances the previous record number.
please assist as soon as possible

I'd start by creating that field on the fly from 3 fields... rather
than storing that field as a single value.

What I mean is, have 3 fields.
TypeText
Counter
CurrentYear

Display of these values would then be:
[TypeText] & " " & format([Counter],"000") & "/" & [CurrentYear]

Then, you can apply logic on the values in the various fields.

You'll have to ask the question differently to get help with applying
the logic.

Jon
Thanks for your help but all am interested with is generation of
numbers or let me put it this way What can i do to autonumber field so
that each time i cancel the updation it maintains its original number
not creating another number
Aug 12 '08 #3
mp********@gmail.com wrote:
On Aug 11, 10:24 pm, jonceramic <joncera...@gmail.comwrote:
>>On Aug 11, 8:43 am, mphil.s...@gmail.com wrote:

>>>I am creating a certain program and in that program i want to add a
field which will be creating numbers with text in sequence older "
Like MPL 001/08 to unlimited " And 08 be current year. This will only
be possible if that field is enebled, if the condition of enebling
this field still is false then the field returns the previous value
that is it maintances the previous record number.
>>>please assist as soon as possible

I'd start by creating that field on the fly from 3 fields... rather
than storing that field as a single value.

What I mean is, have 3 fields.
TypeText
Counter
CurrentYear

Display of these values would then be:
[TypeText] & " " & format([Counter],"000") & "/" & [CurrentYear]

Then, you can apply logic on the values in the various fields.

You'll have to ask the question differently to get help with applying
the logic.

Jon


Thanks for your help but all am interested with is generation of
numbers or let me put it this way What can i do to autonumber field so
that each time i cancel the updation it maintains its original number
not creating another number
My first suggestion is to never add a record into a table that has is
bound to a table with an autonumber.

Second suggestion is to create an unbound form to enter data and never
add it to the table unless the person presses a Save button and is
willing to commit that record.

Third suggestion is to use a LongInt and scrap your autonumber and
create a method to update the field.

If you need sequence, don't use Autonumbers. People that use
autonumbers don't give a flying F about sequences.
Aug 12 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: eric.gagnon | last post by:
In a program randomly generating 10 000 000 alphanumeric codes of 16 characters in length (Ex.: "ZAZAZAZAZAZAZ156"), what would be an efficient way to ensure that I do not generate duplicates? ...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
6
by: Poul Møller Hansen | last post by:
I have made a stored procedure, containing this part for generating a unique reference number. SET i = 0; REPEAT SET i = i + 1; SELECT RAND() INTO reference FROM SYSIBM.SYSDUMMY1; SET...
1
by: Intaek LIM | last post by:
generally, we use srand(time(0)) to generate random numbers. i know why we use time(0), but i can not explain how it operates. first, see example source below. ...
7
by: Gerard Flanagan | last post by:
All would anyone happen to have code to generate Cutter Numbers: eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm or is anyone looking for something to do?-) (I'm under...
1
by: Velhari | last post by:
Hi, I am a beginner. Please tell me, For generating Random Numbers, Initially why we are going for seed method. And another question is that, I want to print unique random number how to print by...
8
by: kiranchahar | last post by:
Hey all, How do I generate random numbers with Uniform distribution Uniform(a,b) using C-programming? I want to generate uniform random numbers which have mean following Uniform(p,q) and also...
1
by: sparks | last post by:
we are generating numbers for the data collection people. this worked fine for a while.. Private Sub generatenumber() Dim db As DAO.Database Dim rs As DAO.Recordset Dim StudentNumber As...
12
by: 9966 | last post by:
Greetings, This is my second post till now. Thanks for all the advice given to me for the first post. Now I'm having problem with generating random numbers. I know if we want to generate a...
26
by: bilgekhan | last post by:
What is the correct method for generating 2 independent random numbers? They will be compared whether they are equal. What about this method: srand(time(0)); int r1 = rand(); srand(rand());...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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: 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: 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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.