Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

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
        .Edit
        If !RCER_TotalTime = 100 Then
            !RCER_Points_AG = 0
            .Update
        End If
        If !RCER_TotalTime < 100 Then
            !RCER_Points_AG = bytPoints
            .Update
        End If
        If bytPoints > 0 Then bytPoints = bytPoints - 1
        .Edit: !RCER_Rank_AG = .AbsolutePosition + 1: .Update
        .MoveNext
    Loop
End With