By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

form field auto numbering with unique value

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.