|
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]
|
|
| 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
| |
|
| 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"
|
|
|
|
|