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

"Autonumber" for each line related to given record.

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


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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.