Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number rows in Query

Status
Not open for further replies.

lexi0088

Technical User
Sep 7, 2004
49
I am trying to number my rows that appear in my queary. The query actually goups and sums data, so the count function will not work. I have the following code in my module:

Global IncrementVariable As Integer
Function IncrementValues(QTY) As Integer
IncrementVariable = IncrementVariable + 1
IncrementValues = IncrementVariable

End Function


The following field in my query:
Seq #: IncrementValues([QTY])

The problem is that the number does not start with 1, it starts with 2 and then increments by 2. It aslo does not reset when I close and rerun the query. Please help.
 
I have figured out part of my problem... I was refrencing this increment field in another field, which was making it increase by 2. Any reason why you cannot reference this field?
 
I am also trying to add a field in my query to include an incremental number for each row of the query result. I started using Access a month ago and so far know nothing about coding and modules. I'm wondering if there is anyway to make this happen without writing code. If coding is a must, could someone tell me where to start?

Thanks a lot in advance!





 
wnz,
Check the FAQs for this forum.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top