Well, Walter, VBA doesn't allow you to create Control Arrays as you can in VB6 so this isn't going to work.
There are ways to work around this for Forms, maybe the techniques will work for Reports as well, I haven't tried it.
http://siddharthrout.wordpress.com/2011/08/05/vba-control-arrays/
Generally, it's not worth the effort to play clever games with reports as it's not like on a screen where your user can scroll across, the paper comes to an end so you might as well stick to predefined controls and making superfluous ones invisible, as Duane and Crystal suggest.
Yrs, Andrew
--- In MS_Access_Professionals@yahoogroups.com, "nkpberk" <wgriffin48@...> wrote:
>
> Hello Group;
> I am trying to format a report that has an unknown number of textboxes to head an similarly unknown number of columns. So I am trying to use the "NEW" keyword to create textboxes on the fly.
>
> Dim txtNB1() As TextBox
>
> With rst1
> If strNB1 <> !Symbol Then
> If !strTrainDirection = "Northbound" And !strTrainClass = "1st" Then
> strNB1 = !Symbol
> NB1 = NB1 + 1
> Set txtNB1(NB1) = New txtNB1
> Me.txtNB1(NB1).Text = !Symbol
> End If
> End If
> etc........
>
> How do I get this to work? and assign values to the new textbox properties?
>
> Walter Griffin
>
Sabtu, 25 Februari 2012
[MS_AccessPros] Re: creating controls in code
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar