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

Forms! Loop Problem 1

Status
Not open for further replies.

kennedymr2

Programmer
May 23, 2001
594
AU
I am trying to loop through a recordset and look at another forms object.

If i directly name the object eg
If Forms!Bookings1!Text_1_1.Enabled Then ...THIS WORKS

BUT... If I use the following code eg
If Forms!Bookings1!fld1.Enabled
VB .cannot find fld1 error ..DOES NOT WORK
------------------------------------
Do While Not rec.EOF
fld1 = "Text_1_" & Trim(Str(LL))
'eg Text_1_1"
'If Forms!Bookings1!fld1.Enabled Then
If Forms!Bookings1!Text_1_1.Enabled Then 'works
taken = 1
End If
rec.MoveNext
Loop
--------------------------------------

Appreciate any help in solving this...

Regards Kennedymr2
 
If Forms!Bookings1.Controls(fld1).Enabled Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PVH very much...

A very quick bit of help...much appreciated..worked fine.

Regards Kennedymr2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top