Another question from a "Access Dummie"
I am attempting to create a Loop that retitle's Label's in a Subform's Subform.
My Main form is named "frm_PRPayPdSummary"
My 1st Subform is named "frm_PRData"
My subform of the 1st Subform is named "frm_PRDataDetail"
I have a query that pulls a list of all Active Pay Types and creates a field called MySeq to sequentially number all Active Pay Types.
On the Main Form I have a Textbox to with a DCount to get the count of all Active Paytypes. I have named that textbox "txtCountofActivePayTypes"
and the formula I used is: =DCount("PRDetailPayTypeAc
That all seems to be working correctly.
On the Sub Subform each of the label's that I want to change are labeled "lblPRDetail#" where the #sign is actually the numbers 1, 2, 3 etc....
Now in the Form Load event I have the following Code
Private Sub Form_Load()
Dim i As Integer
i = 1
For i = 1 To Me.txtCountofActivePayTypes
Me.Controls("[frm_PRData].Form![frm_PRDataDetail].Form![lblPRDetail" & i & "]") = qry_PRDataPayType_CountActive.MySeq.Column(2)
When my query for "qry_PRDataPayType_CountAc
tive" runs the results pull as:
It seems I need a SELECT statement somewhere in there to use the i value to SELECT the right MySeq line........