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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working within a recordset?

Status
Not open for further replies.

Junior1544

Technical User
Apr 20, 2001
1,267
US
i have some code i'm tring to get to work... cam some one take a look, and let me know where i'm going wrong?? i'm tring to get a total count of not only the records, but also the duration between two dates, and those two dates are [intime] and [outtime]... where am i going wrong??
btw, i'm using windows 2k and access 2k...


Dim rs As DAO.Recordset
Dim totvis As Integer
Dim addvis As Integer

Set rs = qryMonthly_Report

addvis = 0
totvis = 0
check = True

rst.MoveFirst

Do While Not REC_ID
addvis = rs.Fields.OUTDATE - rs.Fields.INDATE
totvis = totvis + addvis
rst.MoveNext
Loop

Set rst = Nothing

--Junior... thanks JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
Hi junior!

One thing is that your Set statement needs to read:

Set rs = CurrentDb.OpenRecordset("qryMonthly_Report", dbOpenDynaset)

hth
Jeff Bridgham
bridgham@purdue.edu
 
it just give me an error with the dbOpenDynaset in there... i tried taking it out and it lets me do it... one thing to note, in the recordset, i'm not modifing any data, just reading it, and using to to be the sourse of some stats... this part is only part of a bigger staticical gathering project i'm on...

thanks a bunch... JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top