how can I get item numbers column for a query result?

O

OldPro

how can I get item numbers column for a query result?

Do you want us to guess what you are trying to do? You couldn't
possibly mean "SELECT [Item Numbers] FROM tblSomeTable".
 
M

Morris

how can I get item numbers column for a query result?

Do you want us to guess what you are trying to do? You couldn't
possibly mean "SELECT [Item Numbers] FROM tblSomeTable".

I'm pretty sure that's what he asked for :)

Morris
 
M

mezzanine1974

I have asked the same questions in much more detail but i did not get
any answer. Please see below.

Is there anyway to place a column (Item#) in a query, which will show
the item numbers of the results. Say that, if query result has 13
items, Item# values will be sequentially 1,2,3...11,12,13.
I have a feeling that it might be solved by usind DCOUNT function.
Thanks
 
M

mtn244

Stephen Lebans posted the following on 2/6/2007. Take a look at hs
Rownumber.zip. I think this will do what you want.

HTH,
mtn244

Stephen Lebans' post:

See:
http://www.lebans.com/rownumber.htm
Rownumber.zip is a database containing functions for the automatic row
numbering of Forms, SubForms and Queries.

Updated Oct. 13 by Allen Browne. Includes error handling and cleaned code.



Here's an update to the Serialize function by Peter Schroeder:

Good to hear. FWIW, here's the version I came up with today, based off of
your code and Ken's(Getz) suggestion, with a few changes:


Function Serialize(qryname As String, keyname As String, keyvalue) As Long

Dim rs As Recordset


On Error GoTo Err_Serialize

Set rs = CurrentDb.OpenRecordset(qryname, dbOpenDynaset, dbReadOnly)

rs.FindFirst Application.BuildCriteria(keyname, rs.Fields(keyname).Type,
keyvalue)

Serialize = Nz(rs.AbsolutePosition, -1) + 1


Err_Serialize:

rs.Close

Set rs = Nothing

End Function


Peter Schroeder


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
M

mezzanine1974

mtn244,
Many thanks for your help. I have been looking for such answer for a
long time. What Stephen Lebans did is great job for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top