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

creating a PUBLIC array?

Status
Not open for further replies.

jeffmoore

Programmer
Aug 29, 2003
301
US
Hi
I have an array that is filled by code in the on open event.
I need to display the values from the array on my rpt.
VBA won't let me create a public array... :(
Q: how can I get my array's data to the report's txtboxs?

TIA
jeff
 
I think you can create a module and in the declaration section declare the public array.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
if you are using this inside the same report, why not create a Report Level Array, by dimming it in the General Declarations area.

Option Compare Database
Option Explicit

Dim strArray(1 To 4) As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
txt1 = strArray(1)
txt2 = strArray(2)
txt3 = strArray(3)
txt4 = strArray(4)
End Sub

Private Sub Report_Open(Cancel As Integer)
Dim x As Integer
For x = 1 To 4
strArray(x) = "This is Text " & x
Next x
End Sub


PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top