troubleshooting Question

Help Adjusting the Update Piece of Access VBA Code

Avatar of rsburge
rsburgeFlag for United States of America asked on
Microsoft Access
7 Comments1 Solution357 ViewsLast Modified:
Hello Experts - The code below is working perfectly, however there has been a change in rules and an adjustment to the code is needed.

I need to adjust this With statement so that if there is only 1 record returned in the recordset, the bytPoints value for that record is 5 instead of 10.

Dim bytPoints As Byte
bytPoints = 10
strSQL = strSQLbr1
With CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
    Do Until .EOF
        If !RCER_TotalTime = 100 Then
            !RCER_Points_AG = 0
        End If
        If !RCER_TotalTime < 100 Then
            !RCER_Points_AG = bytPoints
        End If
        If bytPoints > 0 Then bytPoints = bytPoints - 1
        .Edit: !RCER_Rank_AG = .AbsolutePosition + 1: .Update
End With
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros