473,418 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

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 2568
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:F0**********************************@microsof t.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***@discussions.microsoft.com> wrote in message
news:F0**********************************@microsof t.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***@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.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***@discussions.microsoft.com> wrote in message
news:F0**********************************@microsof t.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
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...
2
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...
1
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...
1
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...
6
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...
5
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,...
10
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...
6
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'...
5
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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:
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
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...
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...

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.