travismallen
Programmer
I can't use DAO.Recordset with my Access and I need in a 'For/Next' Loop. This is the program:
'-------------------------------------------------
Dim Check
Dim Counter
Dim TempLoc
Dim rst as DAO.Recordset
Dim i as integer, NumRec as integer
Set rst = CurrentDb.OpenRecordset("tblMsgBank"
Check = True
Counter = 0
Do while Check = True
With Section
TempLoc = .Column(.BoundColumn + 1)&"."&Left(Me.Title,3)&"."&Trim(Counter)
End With
'Start the loop
With rst
.Movelast
NumRec = .Recordcount
.Movefirst
For i = 0 to NumRec - 1
If !Location = TempLoc Then
Check = True
Counter = Counter + 1
Else
Check = False
End If
.MoveNext
Next i
End With
Loop
rst.Close
set rst = Nothing
Me.Location = TempLoc
'-----------------------------------------
can anyone give me an alternative? Thanks
___________________________
"I am what I am" - Popeye
Travis M. Allen
'-------------------------------------------------
Dim Check
Dim Counter
Dim TempLoc
Dim rst as DAO.Recordset
Dim i as integer, NumRec as integer
Set rst = CurrentDb.OpenRecordset("tblMsgBank"
Check = True
Counter = 0
Do while Check = True
With Section
TempLoc = .Column(.BoundColumn + 1)&"."&Left(Me.Title,3)&"."&Trim(Counter)
End With
'Start the loop
With rst
.Movelast
NumRec = .Recordcount
.Movefirst
For i = 0 to NumRec - 1
If !Location = TempLoc Then
Check = True
Counter = Counter + 1
Else
Check = False
End If
.MoveNext
Next i
End With
Loop
rst.Close
set rst = Nothing
Me.Location = TempLoc
'-----------------------------------------
can anyone give me an alternative? Thanks
___________________________
"I am what I am" - Popeye
Travis M. Allen