Help with Array of my type

  • Thread starter Thread starter Diarmuid
  • Start date Start date
D

Diarmuid

Hi
I have to perform several actions on an Invoice. The Invoice can have 1
or 2 lines. So I created my own types for the header and the lines.

'*************************************
Type TranHeader
stAccCode As String * 6
stOurRef As String * 10
stYourRef As String * 10
stDate As String * 8
lSAMRef As Long
iNumLines As Integer
bPosted As Boolean
stError As String * 100
End Type

Type TranLine
stDetail As String * 30
stCost As String * 3
stDept As String * 3
lNominal As Long
sAmount As Single
End Type
'*************************************

I'd like to have TranHeader also contain the lines, so I only have to pass
TranHeader to each function. Whats the best way? I was thinking of creating
an array of type TranLine, but I'm not sure what to do. How would I update
the array then?

Thanks
Diarmuid
 
Hi Diarmuid,

From your descriptions, I understood it to be a data structure issue
instead of Access one. Let me know more detailed about your scenario if I
misunderstood you.

IMO, you might define the types as following:

Type TranHeader
stAccCode As String * 6
stOurRef As String * 10
stYourRef As String * 10
stDate As String * 8
lSAMRef As Long
iNumLines As Integer
bPosted As Boolean
stError As String * 100
MaxTranlines As Integer
Tranlines(1 To 2) As TranLine
End Type

MaxTranlines can indicate whether it contains one TranLine or two TranLine

Thank you for your patience and corperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!


Sincerely yours,

Mingqing Cheng

Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
 

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

Similar Threads

VBA Multiple Line handling with Split() 1
array data type issues - 11
Passing Type Arrays 2
Array Dim 6
Pasting large arrays onto worksheet 0
Help with VBA sql code 2
Type Mismatch 0
Problem with Data Types 3

Back
Top