frustrating
Registered User.
- Local time
- Yesterday, 19:29
- Joined
- Oct 18, 2012
- Messages
- 68
For some reason, this code doesn't seem to be working for me. I've never really had a problem with MoveNext until now.
What I'm trying to do is display all the applicable values form a query recordset into an email, but it's only displaying the last value.
Here is the function I made:
Any idea on why it's not working?
I also had some code that displayed the recordcount, which was displaying the correct amount of records, so it isn't the table or query.
What I'm trying to do is display all the applicable values form a query recordset into an email, but it's only displaying the last value.
Here is the function I made:
Code:
Public Function thepercent()
Dim rsSQL As DAO.Recordset
Dim DB As DAO.Database
Set DB = CurrentDb
Dim strsql As String
strsql = "SELECT [Dept Root Source],[Expr1],[Error Description] FROM converttopercent1 WHERE [converttopercent1].[Dept Root Source] = '" & List20.Value & "'"
Set rsSQL = DB.OpenRecordset(strsql)
Do Until rsSQL.EOF
thepercent = rsSQL!Expr1 & " due to " & [Error Description] & vbCrLf
rsSQL.MoveNext
Loop
rsSQL.Close
Set rsSQL = Nothing
Set DBS = Nothing
End Function
I also had some code that displayed the recordcount, which was displaying the correct amount of records, so it isn't the table or query.
Last edited: