View Single Post
Old 06-17-2007, 12:08 AM   #15 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Insert Table Data into Array

DJMaze,

Brilliant. So that's used to display specific information within the array, but how do you put information into the array using variables, in order to use the the following code:

Code:
$record[1]['name']
The following VB code uses an array that inherits the name, species, sex variables "record() as details" Each piece of information is called using the array position, an the variable it is going to be coming out of.
Code:
Private Type details
  name As String
  species As String
  sex As String
End Type
Dim record() As details

Private Sub Form_Load()
  ReDim record(0)
End Sub

Private Sub lblNext_Click()
  ReDim Preserve record(UBound(record) + 1)
  record(UBound(record)).name = txtName.Text
  MsgBox record(1).name
End Sub
Many Thanks,
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote