Solved

Save a small integer array as part of a udt

Posted on 2014-01-18
5
156 Views
Last Modified: 2014-01-19
How to include this array into the udt below
mMarkedNumber(1 To 10)  As Integer
can this be done if yes how ?

Public Type SavedKenoGameGame
tmpbetMode As Integer
tmpSpotMarked As String * 2
tmpLabelCredit As Currency
tmpRuns As Long
tmpLost As Currency
tmpWon As Currency
tmpWonLostPerRun As Currency
tmpBiggestWin As Currency
tmpTotalBet As Currency

End Type

can this be done if yes how ?
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 500 total points
ID: 39791805
What is the problem?
'===Module===
Public Type SavedKenoGameGame
tmpbetMode As Integer
tmpSpotMarked As String * 2
tmpLabelCredit As Currency
tmpRuns As Long
tmpLost As Currency
tmpWon As Currency
tmpWonLostPerRun As Currency
tmpBiggestWin As Currency
tmpTotalBet As Currency
mMarkedNumber(1 To 10) As Integer
End Type

Open in new window


'===Form===
Dim z As SavedKenoGameGame

Private Sub Form_Load()
   For i = 1 To 10
      z.mMarkedNumber(i) = i * 100
   Next i
End Sub

Private Sub Command1_Click()
   MsgBox z.mMarkedNumber(3)
End Sub

Open in new window

0
 

Author Closing Comment

by:isnoend2001
ID: 39791833
Thanks
no problem now
0
 

Author Comment

by:isnoend2001
ID: 39791844
how do i save the array ?
this does not work:
Dim CleoGame As SavedKenoGame
   With CleoGame
    .tmpbetMode = mBetMode
    .tmpSpotMarked = Val(lblMarked)
    .tmpLabelCredit = lblCredit.Caption
    .tmpRuns = Val(gridCardStats.TextMatrix(2, 1))
    .tmpLost = CCur(gridCardStats.TextMatrix(5, 1))
    .tmpWon = CCur(gridCardStats.TextMatrix(4, 1))
    .tmpWonLostPerRun = CCur(gridCardStats.TextMatrix(7, 1))
    .tmpBiggestWin = CCur(gridCardStats.TextMatrix(3, 1))
    .tmpTotalBet = CCur(lblBet)
    .tmpWonLost = CCur(gridCardStats.TextMatrix(6, 1))
    .mMarkedNumber = mMarkedNumber
End With
0
 
LVL 28

Expert Comment

by:Ark
ID: 39791846
.tmpWonLost = CCur(gridCardStats.TextMatrix(6, 1))
For i=1 To 10
 .mMarkedNumber(i) = mMarkedNumber(i)
Next i
0
 

Author Comment

by:isnoend2001
ID: 39792057
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question