Vba

Log in to stop seeing adverts

Status
Not open for further replies.

Darth Vodka

Well-Known Member
In VBA, if I'm declaring 3 variables in a class object definition, e.g.

Public strY1GraphType As String
Public strY2GraphType As String
Public strY3GraphType As String

which works fine

How come it won't let me declare

Public strGraphType(3) As String

????

As arrays are not allowed in object modules :-(
 
In VBA, if I'm declaring 3 variables in a class object definition, e.g.

Public strY1GraphType As String
Public strY2GraphType As String
Public strY3GraphType As String

which works fine

How come it won't let me declare

Public strGraphType(3) As String

????

As arrays are not allowed in object modules :-(

Is the syntax correct ? :102:
 
hmmm

i need to declare it as private and then do let & get....

ho hum

If this follows the Java style then I would expect something like

Public strGraphType() As String

then a declaration to allocate the size of the array

Somevbafunctiontosizearrays strGraphType(3); :102:
 
Did this get sorted? :102:
 
Did this get sorted? :102:


yeah, i ended up with:-

Private int_P_GraphType(3) As Integer

Public Property Get intGraphType(Index As Integer) As Integer
intGraphType = int_P_GraphType(Index)
End Property
Public Property Let intGraphType(Index As Integer, ByVal NewValue As Integer)
int_P_GraphType(Index) = NewValue
End Property


i'm working on an access databases that kicks out graphs in a spready, it's pretty good
 
Status
Not open for further replies.
Log in to stop seeing adverts

Championship

P Pld Pts
1Leicester4697
2Ipswich4696
3Leeds Utd4690
4Southampton4687
5West Brom4675
6Norwich City4673
7Hull City4670
8Middlesbro4669
9Coventry City4664
10Preston 4663
11Bristol City4662
12Cardiff City4662
13Millwall4659
14Swansea City4657
15Watford4656
16Sunderland4656
17Stoke City4656
18QPR4656
19Blackburn 4653
20Sheffield W4653
21Plymouth 4651
22Birmingham4650
23Huddersfield4645
24Rotherham Utd4627
Top