Quick Question about Report Coding

  • Thread starter Thread starter Brandon Johnson
  • Start date Start date
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
 
The information that you want to extract are they from unbound textboxes
inputted by the user from a dialog form or is the information from a table.
Can you be more specific.

Thanx!
 
Thankyou so much for the reply. Well its actually sort of a complex
routine that im doing. The way i get all 8 values separated by commas
per variable, is i have a recordset that i go through and find certain
indexes that i need and extract the contents of the indexes into this
string variable. If you have ANY other questions or work arounds or
comments please feel free to ask/say. your help as well as your help is
greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top