R
RadarUK
Guest
I am trying to loop through textboxes so that I can fill the textboxes with values from a recordset. The loop isn't the problem, the problem is assigning the textbox name to a contol. Here is the code:
Dim QtyBrk As TextBox
Dim sTempString As String
Do While Not m_rsQtyDet.EOF
sTempString = "txtQtyBrk" & QtyCount 'Textboxes called txtQtyBrk1, txtQtyBrk2, etc.. Maximum 5
Set QtyBrk = sTempString
QtyBrk.Enabled = True 'Qty_Details!QtyBrkNum
QtyBrk = m_rsQtyDet!QtyBrkNum
I need to know how to Set the textbox name property using the string variable.
Thanks in advance
Dim QtyBrk As TextBox
Dim sTempString As String
Do While Not m_rsQtyDet.EOF
sTempString = "txtQtyBrk" & QtyCount 'Textboxes called txtQtyBrk1, txtQtyBrk2, etc.. Maximum 5
Set QtyBrk = sTempString
QtyBrk.Enabled = True 'Qty_Details!QtyBrkNum
QtyBrk = m_rsQtyDet!QtyBrkNum
I need to know how to Set the textbox name property using the string variable.
Thanks in advance