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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object variables

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
can anyone help me to convert strings to object variables??

 
here are some more details to my problem about passing string values to the object variable


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)


If Me.chk1__1.Value = True Then
Me.txt1__1.ForeColor = RGB(255, 0, 0)
Else
Me.txt1__1.ForeColor = RGB(0, 0, 0)
End If

If Me.chk1__2.Value = True Then
Me.txt1__2.ForeColor = RGB(255, 0, 0)
Else
Me.txt1__2.ForeColor = RGB(0, 0, 0)
End If

If Me.chk1_1.Value = True Then
Me.txt1__3.ForeColor = RGB(255, 0, 0)
Else
Me.txt1__3.ForeColor = RGB(0, 0, 0)
End If

etc,etc

** the code below can 'pick' out all my required named controls but i want to pass their string values, src to the above code so that i don't have to keep typing me.txt.... as i have 35 controls to write code for


trigger = Array("1", "2", "3", "4", "5", "6")
level = Array("+1", "-1", "-2", "-3", "-4")



For inti = 1 To 1
For intj = 1 To 2
src = "txt" & trigger(inti) & "_" & level(intj)
msg = MsgBox(src)
srcc = "chk" & trigger(inti) & "_" & level(intj)
msg = MsgBox(srcc)

' some code to format the txt box if the chk box is ticked

Next intj
Next inti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top