Home > Archive > MS Access database support > April 2006 > dao help









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author dao help
congngo@yahoo.com

2006-04-05, 8:28 pm

Hi all

My code is working fine. I just need help with looping
the rst.move

Dim rst As Recordset
Dim varCXL1, varCXL2, varclx3, varCXL4, varCXL5 As Integer

Set rst = CurrentDb.OpenRecordset("qry_cxlcount")
rst.MoveFirst
varCXL1 = rst!countcxl
rst.MoveNext
varCXL2 = rst!countcxl
rst.MoveNext
varCXL3 = rst!countcxl
rst.MoveNext
varCXL4 = rst!countcxl
rst.MoveLast
varCXL5 = rst!countcxl
set rst = Nothing


Can I loop "move" to make it look better

salad

2006-04-05, 8:28 pm

congngo@yahoo.com wrote:
> Hi all
>
> My code is working fine. I just need help with looping
> the rst.move
>
> Dim rst As Recordset
> Dim varCXL1, varCXL2, varclx3, varCXL4, varCXL5 As Integer
>
> Set rst = CurrentDb.OpenRecordset("qry_cxlcount")
> rst.MoveFirst
> varCXL1 = rst!countcxl
> rst.MoveNext
> varCXL2 = rst!countcxl
> rst.MoveNext
> varCXL3 = rst!countcxl
> rst.MoveNext
> varCXL4 = rst!countcxl
> rst.MoveLast
> varCXL5 = rst!countcxl
> set rst = Nothing
>
>
> Can I loop "move" to make it look better
>

Dim ar(5)
Set rst = CurrentDb.OpenRecordset("qry_cxlcount")
rst.MoveFirst
For i = 1 to 5
ar(i) = rst!Countcx1
rst.MoveNet
Next
set rst = Nothing

congngo@yahoo.com

2006-04-06, 3:29 am

does not work

error message "object required"

congngo@yahoo.com

2006-04-06, 3:29 am

nevermind I misstyped the word "rst!countcxl1"

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com