We are trying to concatenate in a rst statement. The commented line works just fine. Would like to make the next line work in the loop. I've tried many different variations. Just can't get it to work.
Code:
For intA = 7 To 25
strA = "Me.Field" & intA
Set dbs = CurrentDb
'Set rst = dbs.OpenRecordset("SELECT Descrip FROM tbltests where tbltests.test ='" & Me.Field7 & "'; ")
Set rst = dbs.OpenRecordset("SELECT Descrip FROM tbltests where tbltests.test ='" & strA & "'; ")
If rst.RecordCount = 0 Then
MsgBox "empty"
End If
strB = "txtDescrip" & intA
strB = rst.DESCRIP
Set rst = Nothing
Set dbs = Nothing
Next intA