Hi,
I'm hoping somebody may be able to help.
I have written the bit of code below, but I have about 40 text boxes that need to be populated, is there anyway I can loop through them. Rather than copying the below code 40 times and changing the text box name to Me.txtname2 , me.txtname3 ect. Hope somebody can help. Thanks in advance
Set rs = db.OpenRecordset("olcalldata")
lngRed = RGB(255, 0, 0)
lngyellow = RGB(255, 255, 0)
Me.txtname1 = rs!pa
If rs!Status = "Busy" Then
Me.txtname1.BackColor = lngRed
Else
Me.txtname1.BackColor = lngyellow
End If
I'm hoping somebody may be able to help.
I have written the bit of code below, but I have about 40 text boxes that need to be populated, is there anyway I can loop through them. Rather than copying the below code 40 times and changing the text box name to Me.txtname2 , me.txtname3 ect. Hope somebody can help. Thanks in advance
Set rs = db.OpenRecordset("olcalldata")
lngRed = RGB(255, 0, 0)
lngyellow = RGB(255, 255, 0)
Me.txtname1 = rs!pa
If rs!Status = "Busy" Then
Me.txtname1.BackColor = lngRed
Else
Me.txtname1.BackColor = lngyellow
End If