|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Generate line no within each Sales Order
Hi,
I would like to generate a line no. before inserting records of different sales order into Access database. For example, if there are 2 items in order no. 1, then I should have the following in the table: Order no line no item ----------------------------- Ord1 1 item1 Ord1 2 item2 How to achieve this? Thanks a lot! |
|
#2
|
|||
|
|||
|
If you have a line number column in your database table just put the line number value in it. Am I missing something?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Yes, I have a line no. column...but I should get the current line no. in which event? the "before insert"??
Because I have set the Order No. and Line No. as primary key, I cannot insert the record before having a proper line no. |
|
#4
|
|||
|
|||
|
I wouldn't put line number as part of a primary key myself. If you do you won't be able to re-arrange the lines if necessary.
You can use SELECT Max(linenumber) AS LineNo FROM table, which will put the highest line number in rs("LineNo"). Add 1 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Generate line no within each Sales Order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|