Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple unbound textboxes

Status
Not open for further replies.

jammerdk

Technical User
Aug 16, 2001
51
0
0
DK
Hi guys

I'm having a form with multiple unbound textboxes (1..30) on it.

Now i'd like to change the backgroundcolor on all of them depending on a lookuptable. I know it can be done manually but i'd like to tweak the code so I hope you guys can help me.

My own try of getting the code tweaked textboxes looks as follows.


if me.[(i) & textbox2008] > Dlookup("Value", "tblCheck")then
For i = 1 to 30
me.[(i) & textbox2008].backcolor = 255
next i
end if

 
yeah JBinQld it might be in right direction

Dim ctl As Control
For Each ctl In Form.frmSkemaRa.Controls
If (ctl.Controls = acTextBox) Then
ctl.BackColor = 255
End If
Next ctl

but insttaid of it changing the backcolor because of the control being a textbox...i'd like it to change if it's a given value.

I tried this without any luck

Dim ctl As Control
For Each ctl In Form.frmSkemaRa.Controls
If (ctl.value < 125) Then
ctl.BackColor = 255
End If
Next ctl
 
getting warmer

For m = 1 To 16
AcceptNumber = DLookup("antal", "tblSkema", Material = Form.frmSkemaRa.Controls("Mat" & m).Value)
Next m

For i = 1 To 32
If Trim(Form.frmSkemaRa.Controls(i & "Ra056").Value) < AcceptNumber Then
Form.frmSkemaRa.Controls(i & "Ra056").BackColor = 255
End If
Next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top