473,591 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form field auto numbering with unique value

Before I started to create table, etc to track unique form field record
number assigments I thought I'd check to see if there is now a better way to
do this in .NET.

I have a parent form (table) and children form (table). Relationship equals
one to many. I'd like to auto number the fields accordingly and traditionaly
I assign a unique number based on a table value that I retrieve + 1.
i.e.
Parent record field value = 1
Children record field value = 1-1, 1-2, 1-3

I assume that I could get the next field auto-increment interger for the
parent table record and assign my parent field to it. But what about the
child field then that I need to relate to that parent for each child? Make
sense?

Do I search the child table getting results for number of records for parent
match then add 1 to it? I would think that there is a better way now.

A simple way to uniquely number the parent record and the child, with the
child record also having the parent assigment value. But the child has to
start at one each time. Can I do this in my SQl Server 2K field properties?

thanx.

Nov 19 '05 #1
3 2579
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:F0******** *************** ***********@mic rosoft.com...
Before I started to create table, etc to track unique form field record
number assigments I thought I'd check to see if there is now a better way
to
do this in .NET.

I have a parent form (table) and children form (table). Relationship
equals
one to many. I'd like to auto number the fields accordingly and
traditionaly
I assign a unique number based on a table value that I retrieve + 1.
i.e.
Parent record field value = 1
Children record field value = 1-1, 1-2, 1-3

I assume that I could get the next field auto-increment interger for the
parent table record and assign my parent field to it. But what about the
child field then that I need to relate to that parent for each child? Make
sense?

Do I search the child table getting results for number of records for
parent
match then add 1 to it? I would think that there is a better way now.

A simple way to uniquely number the parent record and the child, with the
child record also having the parent assigment value. But the child has to
start at one each time. Can I do this in my SQl Server 2K field
properties?


What are you planning to do with the field numbers?

John Saunders
Nov 19 '05 #2
That's the issue. I put them into a form textbox (disabled) because the user
can also on that form (both parent and child) call up pop-up's that need
those numbers to also associate that record to.
i.e if you're on the child record and it's number is 1-1 then if you pop-up
the upload image modal form then that image is associated to that number
also. For retrieval later so that specific detail record number.
The big issue isn't the parent becuase I can get that and make it unqiue,
the child has the chnace to have multiple users adding to it (small
possiblity) so if I assign it the numbering sequence of 1,2,3... then if 3
has been assigned (by routine checking last detail/child record) and then
another user adds a record and gets the same number because the 1st user has
not saved their record. It's a small chance, but a chance nonetheless. I
could "lock" the child/detail table but that would kill all other users
working/adding new parents and children to them. And since it's a new record
and not modifying an existing one I can't lock it either. Unless there is a
way to lock based on a serach criteria (i.e. if parent = "1" then lock all
associated child records)??????
Make sense?
"John Saunders" wrote:
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:F0******** *************** ***********@mic rosoft.com...
Before I started to create table, etc to track unique form field record
number assigments I thought I'd check to see if there is now a better way
to
do this in .NET.

I have a parent form (table) and children form (table). Relationship
equals
one to many. I'd like to auto number the fields accordingly and
traditionaly
I assign a unique number based on a table value that I retrieve + 1.
i.e.
Parent record field value = 1
Children record field value = 1-1, 1-2, 1-3

I assume that I could get the next field auto-increment interger for the
parent table record and assign my parent field to it. But what about the
child field then that I need to relate to that parent for each child? Make
sense?

Do I search the child table getting results for number of records for
parent
match then add 1 to it? I would think that there is a better way now.

A simple way to uniquely number the parent record and the child, with the
child record also having the parent assigment value. But the child has to
start at one each time. Can I do this in my SQl Server 2K field
properties?


What are you planning to do with the field numbers?

John Saunders

Nov 19 '05 #3
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:E6******** *************** ***********@mic rosoft.com...
That's the issue. I put them into a form textbox (disabled) because the
user
can also on that form (both parent and child) call up pop-up's that need
those numbers to also associate that record to.
i.e if you're on the child record and it's number is 1-1 then if you
pop-up
the upload image modal form then that image is associated to that number
also. For retrieval later so that specific detail record number.
The big issue isn't the parent becuase I can get that and make it unqiue,
the child has the chnace to have multiple users adding to it (small
possiblity) so if I assign it the numbering sequence of 1,2,3... then if 3
has been assigned (by routine checking last detail/child record) and then
another user adds a record and gets the same number because the 1st user
has
not saved their record. It's a small chance, but a chance nonetheless. I
could "lock" the child/detail table but that would kill all other users
working/adding new parents and children to them. And since it's a new
record
and not modifying an existing one I can't lock it either. Unless there is
a
way to lock based on a serach criteria (i.e. if parent = "1" then lock all
associated child records)??????
Make sense?
No, not really. Don't these tables have primary keys? Why not use the
primary key to identify the record, since that's what it's for?

John Saunders

"John Saunders" wrote:
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:F0******** *************** ***********@mic rosoft.com...
> Before I started to create table, etc to track unique form field record
> number assigments I thought I'd check to see if there is now a better
> way
> to
> do this in .NET.
>
> I have a parent form (table) and children form (table). Relationship
> equals
> one to many. I'd like to auto number the fields accordingly and
> traditionaly
> I assign a unique number based on a table value that I retrieve + 1.
> i.e.
> Parent record field value = 1
> Children record field value = 1-1, 1-2, 1-3
>
> I assume that I could get the next field auto-increment interger for
> the
> parent table record and assign my parent field to it. But what about
> the
> child field then that I need to relate to that parent for each child?
> Make
> sense?
>
> Do I search the child table getting results for number of records for
> parent
> match then add 1 to it? I would think that there is a better way now.
>
> A simple way to uniquely number the parent record and the child, with
> the
> child record also having the parent assigment value. But the child has
> to
> start at one each time. Can I do this in my SQl Server 2K field
> properties?


What are you planning to do with the field numbers?

John Saunders

Nov 19 '05 #4

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

Similar topics

4
6447
by: Phillip J. Allen | last post by:
Hi all, I have a table with an “autonumber” primary key field that also acts as a foreign key in 2 other tables. I would like to programmatically add a new record to the first table and the other 2 child tables. The reason for doing this is to copy one complete record (parent and child table records) into a new record so the user can make a few modifications. So how do I determine what will be the next auto-generated number for my...
2
4130
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5 Groups - call them A to E. I'd like to generate a further automatic reference number based on something like Group/Unique ID so when I create a new record Access creates the Unique ID & I then enter in the group and then Access combines the two...
1
1755
by: Sabine Oebbecke | last post by:
Hi there, Need some help again ... I have a continuous form which shows the attendees of a competition as per their placing in the competition. So, the first record is the winner, the second record is the 2nd place, etc. The continuous form's recordsource is an updatable query. The query/form has got a field 'place' into which the reached place is
1
1279
by: Mike Heden | last post by:
What are the rules regarding the linking fields between a form and subform? Does the field on the main form *have* to be based on a primary key? Most examples seem to quote the use of a primary key on the main form, but I've seen one or two places where it's implied that this doesn't have to be the case - references in the help file to 'normally' using a primary key, etc. For various historical reasons I find myself having to...
6
5057
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I do with the 1st column ? (Below I have a "1" in place for now). Also, Does the datase.AcceptChanges(); updates the changes to the database? Which command do I use to update the changes in dataset back to the Access database table? Thanks, Alpha...
5
5145
by: Paulovič Michal | last post by:
hi all, I have problem with SERIAL field type (or sequence functionality). I have table with three columns - ID, IDS, NAME. I want auto-increment IDS grouped by ID. Example: 1, 1, Ferdo 1, 2, John 2, 1, Martin 1, 3, Elvira
10
1825
by: Marina | last post by:
Can anyone tell me if there is a way to auto number by category? I have 2 tables, ExpenseCategories and Vendors. Each there are many vendors to each expense category, but each category has a specific set of numbers for each vendor listed in it. i.e. Expence Catigory is Office Supplies... all vendors for that catigory are listed between 22401 and 22499. Is there a way to have it auto number so Office supplies would start at
6
2000
by: dream2rule | last post by:
<form action='' method='post' name='create_table_form' id='create_table_form' > <table border='0' cellpadding='0' cellspacing='0' width='95%'><tr><td><br /> <table border='0' cellpadding='0' cellspacing='0' width='100%'> <tr><td>&nbsp;Database Name:</td> <td><input type='text' name='db_name' size='20' value=<?php echo $db_name; ?>></td></tr> <tr><td><br>&nbsp;Table Name:</td> <td><br><input type='text' name='table_name' size='20'...
5
8082
by: David Wright | last post by:
Hello Everyone I would be grateful if someone could help me with the automatic increment of a field on my subform called ‘Test_SrNo’. I am Using Microsoft Office 2000. The auto entry of the incremented number would help to reduce errors and make data entry simpler. The next record in the Test_SrNo field should not have any entry in it until the text insertion point enters the Test_SrNo field. Example: If the last test serial number...
0
7870
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8225
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5732
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3850
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2378
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 we have to send another system
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1199
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.