B
Brandon Johnson
I need to do something a bit out of the ordinary as far as reports go,
so im hoping someone's able to help me. What i would like to do is pass
7 separate varibles, which hold 8 different strings separated by
commas. i will extract bits and pieces of each string in hopes of
putting the values i extract in each textbox i have within the page
header section of the report. My question is, is this possible to do
because im TRYING to conduct a textbox control array and assign the
values to the textboxes. The problem is, i get a runtime error right
out of the gate when i assign a control to an array slot. Below is my
scenerio: If you have any thoughts or comments, it would be greatly
appreciated cuz i dont see any other way of assigning 7 diff SELECT
statements to the reports record source.
Dim i As Integer
Dim x As Integer
Dim cntr As Integer
Dim dpts(6) As String
Dim Fielder(0 To 7) As Object
dpts(0) = GroceryStrng
dpts(1) = FrozenStrng
dpts(2) = FreshFoodsStrng
dpts(3) = DairyStrng
dpts(4) = MeatStrng
dpts(5) = HBCStrng
dpts(6) = GMStrng
Fielder(0) = txtGroceryDept
Fielder(1) = txtGroceryRegion
Fielder(2) = txtGroceryRetailers
Fielder(3) = txtGroceryNumStores
Fielder(4) = txtGroceryPubSlot
Fielder(5) = txtGroceryPaidSlot
Fielder(6) = txtGroceryContact
Fielder(7) = txtGroceryWarehouse
cntr = 0
For i = 0 To UBound(dpts)
For x = 1 To Len(dpts(i))
If Mid(dpts(i), x, 1) = "," Then
If cntr <> 8 Then
cntr = cntr + 1
End If
Else
Fielder(cntr) = Fielder(cntr) & Mid(dpts(i), x, 1)
End If
Next
Exit Sub
Next
so im hoping someone's able to help me. What i would like to do is pass
7 separate varibles, which hold 8 different strings separated by
commas. i will extract bits and pieces of each string in hopes of
putting the values i extract in each textbox i have within the page
header section of the report. My question is, is this possible to do
because im TRYING to conduct a textbox control array and assign the
values to the textboxes. The problem is, i get a runtime error right
out of the gate when i assign a control to an array slot. Below is my
scenerio: If you have any thoughts or comments, it would be greatly
appreciated cuz i dont see any other way of assigning 7 diff SELECT
statements to the reports record source.
Dim i As Integer
Dim x As Integer
Dim cntr As Integer
Dim dpts(6) As String
Dim Fielder(0 To 7) As Object
dpts(0) = GroceryStrng
dpts(1) = FrozenStrng
dpts(2) = FreshFoodsStrng
dpts(3) = DairyStrng
dpts(4) = MeatStrng
dpts(5) = HBCStrng
dpts(6) = GMStrng
Fielder(0) = txtGroceryDept
Fielder(1) = txtGroceryRegion
Fielder(2) = txtGroceryRetailers
Fielder(3) = txtGroceryNumStores
Fielder(4) = txtGroceryPubSlot
Fielder(5) = txtGroceryPaidSlot
Fielder(6) = txtGroceryContact
Fielder(7) = txtGroceryWarehouse
cntr = 0
For i = 0 To UBound(dpts)
For x = 1 To Len(dpts(i))
If Mid(dpts(i), x, 1) = "," Then
If cntr <> 8 Then
cntr = cntr + 1
End If
Else
Fielder(cntr) = Fielder(cntr) & Mid(dpts(i), x, 1)
End If
Next
Exit Sub
Next