473,395 Members | 1,738 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,395 software developers and data experts.

How set to initial value to max+1 of group

A container holds items that can be arranged by a person.
A container may contain only one of a given item.

Containers
-----
ContainerId (unique)
ContainerName (unique)
other columns

Items
-----
ItemId (unique)
ItemName (unique)
other columns

ContainerItems
-----
ContainerId
ItemId (unique Containerid x ItemId)
DisplayIndex (unique Containerid x ItemId x DisplayIndex)
other columns

When an item is added to a container the new record will be
[ContainerId], ItemId, Max(DisplayIndex)+1 where
ContainerId=[ContainerId] as DisplayIndex
Can the max+1 be enforced at the database level, or can it only be
done via a form?

The planned form will contain continuous subform

Container
+-- Items --+
--- Item --- DisplayIndex
--- Item --- DisplayIndex
--- Item --- DisplayIndex

When a new row is added to the subform, what event could be handled to
enforce max+1?
Are there any good 'drag and drop' controls for reordering?

Feb 15 '07 #1
0 1299

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

Similar topics

4
by: Denis St-Michel | last post by:
Hello All, Hope some Guru will be able to help me with this. Let's take this example table A ------------------------------------------------------------------------------- id | ...
3
by: Not4u | last post by:
I would like to know which products are my best sells by sellers, but i would like to retreive this info by product id, seller id and the total amount of sells for this product. My Sells table...
8
by: Fred L. Kleinschmidt | last post by:
I need to know the largets value representable in a variable. However, I do not know the variable's true type - only that it is some kind of int. It may be any of the following: #typedef Newtype...
10
by: Gene | last post by:
Hi, i'm a new vb user, may i ask how to get the max value from the followin situation? Dataset name: dataset11 Table name: Employee Column name: StaffID the syntax is??? txtMaxStaffID.text...
7
by: KevinMGore | last post by:
I'm trying to create a getFunction that returns a single value from an sql table (the next sequence number actually in a group of records). I tried two different methods, a command and data...
1
by: Vic Cekvenich | last post by:
I am trying to write a sigle command to update the max number from detail. Something like: update group set max_msgid=max(c.msgid) from group g, content c where g.id=c.g_id So group is...
4
by: raghav | last post by:
Hi all I am having a SP which is returning a value......Now I have to store that value in session...I saw some examples in msdn lib ----> string Name=string.Empty; Session=Name.ToString(); ...
1
by: Chris H | last post by:
Hi, I'm trying to outer join to a maximum date value using a subquery in order to return company information and the last activity date associated. The basic working "sub" query is: SELECT...
6
daJunkCollector
by: daJunkCollector | last post by:
Hey, I am having a problem with a SQL statement. I hope someone can help me. I have a table with one key column, ID and two columns, Value and Date. I have a variable that contains a certain...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
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,...

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.