473,327 Members | 2,090 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,327 software developers and data experts.

"Autonumber" for each line related to given record.

Hi,

I am trying to assign "autonumber" for each line related to given
record.

TRANSACTION# DATE AMOUNT
3 01/01/05 100
3 01/01/05 150
3 01/01/05 50
4 02/05/05 1000
4 02/05/05 500

I would like to have another column LINE_NO

TRANSACTION# DATE AMOUNT LINE_NO
3 01/01/05 100 1
3 01/01/05 150 2
3 01/01/05 50 3
4 02/05/05 1000 1
4 02/05/05 500 2

Please help with query.
Thanks

Nov 13 '05 #1
2 1483
pl*****@hotmail.com wrote:
Hi,

I am trying to assign "autonumber" for each line related to given
record.

TRANSACTION# DATE AMOUNT
3 01/01/05 100
3 01/01/05 150
3 01/01/05 50
4 02/05/05 1000
4 02/05/05 500

I would like to have another column LINE_NO

TRANSACTION# DATE AMOUNT LINE_NO
3 01/01/05 100 1
3 01/01/05 150 2
3 01/01/05 50 3
4 02/05/05 1000 1
4 02/05/05 500 2

Please help with query.
Thanks


In the BeforeUpdate of the form used to do inserts....

If Nz(Me!LINE_NO, 0) = 0 Then
Me!LINE_NO = Nz(DMax("LINE_NO", "TableName","[TRANSACTION#] = " &
Me![TRANSACTION#] & ""), 0) + 1
End If
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

If Nz(Me!LINE_NO, 0) = 0 Then
Me!LINE_NO = Nz(DMax("LINE_NO", "TableName","[TRANSACTION#] = " &
Me![TRANSACTION#] & ""), 0) + 1
End If
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Sorry, forgot to mention. I'm would like to get a result as a part of a
query.

Thanks

Nov 13 '05 #3

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

Similar topics

0
by: elvin | last post by:
Okay - apologize in advance for the length, but I want to make sure all you knowledgeable and helpful people have all the details you need to hopefully point my newbie rear in the right direction....
6
by: Tom | last post by:
Is there a way to not display "Autonumber" in the primary key testbox when the PK is an autonumber in a new record? Tom
4
by: S. Graefner | last post by:
I have been unable to locate anywhere the answer to my problem. I would like to be able to download/import a single record. This record is stored in many different related (one to one) tables. I...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
4
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is...
2
by: John Phelan-Cummings | last post by:
After creating a button on a (parent) form linking to another (child) form, I received the following error when clicking on the command button: "The OpenForm action was canceled" No the child...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
5
AccessIdiot
by: AccessIdiot | last post by:
Argh! Just when I think everything is working and I am doing one final test before showing it to the guys I built the db for, Access throws out a weird message and won't let me add a record. But only...
4
by: PW | last post by:
Hi, I set up a relationship between two tables with the itineraryid fields in both tables: tblDailyItinerary tblDailyMeals I have a form that writes a record to tblDailyItinerary that...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.