wh00t
Registered User.
- Local time
 - Today, 06:41
 
- Joined
 - May 18, 2001
 
- Messages
 - 264
 
Hi
I have some code which loops through records in a recordset, then changes the properites on a control in a form.
e.g. for each record in table Bay (numbered 1-209), check that the equivalent control on the form has data in, if so then change the backcolor of an adjoined control
using the tID variable works for updating the control name to check, but I can not find a way to update the control name to change the backcolor, I tried using the same method as tID, but when I do this it doesn't recognize it as a control name
does anyone have any ideas?
	
	
	
		
 I have some code which loops through records in a recordset, then changes the properites on a control in a form.
e.g. for each record in table Bay (numbered 1-209), check that the equivalent control on the form has data in, if so then change the backcolor of an adjoined control
using the tID variable works for updating the control name to check, but I can not find a way to update the control name to change the backcolor, I tried using the same method as tID, but when I do this it doesn't recognize it as a control name
does anyone have any ideas?
		Code:
	
	
	Set db = CurrentDb
Set Rs = db.OpenRecordset("Bay")
Rs.MoveFirst
Do While Not Rs.EOF
tID = "t" & Rs![Bay]
ctID = "Ctl" & Rs![Bay]
If IsNull(tID) Then
    Ctl1.BackColor = 12632256
End If
If Not IsNull(tID) Then
    Ctl1.BackColor = 8665
End If
Rs.MoveNext
Loop