I have a loop going through each record, and comparing different values. In some cases I need to change the background color of just one text box.
How do I reference that rows textbox? I thought I could use an index, but cannot find it. Like: Form.Row(i) or
Me.subfrm_import_solidworks_detail.Form.Controls!nPartNumber.BackColor = vbRed
Set Me!subfrm_import_solidworks_detail.Form.Recordset = rsSW
i = 0
If Not (rsSW.EOF And rsSW.BOF) Then
rsSW.MoveFirst
Do Until rsSW.EOF = True
If IsNull(rsSW.Fields("[PART NUMBER]").value) Then
gImportHasErros = True
' This changes all rows, I want only the current rows, textbox
Me.subfrm_import_solidworks_detail.Form.Controls!nPartNumber.BackColor = vbRed
End If
'Move to the next record. Don't ever forget to do this.
rsSW.MoveNext
i = i + 1
Loop
Else
' MsgBox "There are no records in the recordset."
End If
ex.png