Link to home
Start Free TrialLog in
Avatar of peispud
peispudFlag for Canada

asked on

Two dimensional array of a type structure in access vba

Hi

I am using  Access 2010

I would like to create a two dimensional array.    (I actually think that I am asking for a two dimensional array of a "type structure". )
The first element would be an integer. The second would be a string

myarray(0,0) = 1
 myarray(0,1) = "test"            ... etc

Thank you
Avatar of Mohamed_allabakash
Mohamed_allabakash
Flag of India image

You can use variant datatype in these case..
 
Dim A As Variant
A = 10,"Twenty", 30
B = A(2)
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peispud

ASKER

I am hoping to not use variants.
Avatar of peispud

ASKER

When I put in the code below,  Access produces an error when I try to load the form

Option Compare Database
Option Explicit

Public Type myType
    myNum As Integer
    myStr As String
End Type
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peispud

ASKER

Everything became perfect after I moved the type declaration to a code module.

Thank you very much!  This was some "just on time" help.
glad to be of service.