by Brandon (46 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 3rd July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This will be a useful applicaton for printing a list of student's records on a form.
'following code below and place the
'command button on a form.
'Notice I did not change the name of the form, I used the
'default name here as well as the default name for the command button
Private Sub Command1_Click()
'declarations
Const MaxStudent As Integer = 5
Dim StudentNameArray(1 To MaxStudent) As String
Dim StudentIDArray(1 To MaxStudent) As Long
Dim x
Dim Counter As Integer
Counter = 1 'initialize
Do While Counter < MaxStudent
StudentNameArray(Counter) = InputBox("Enter your name")
StudentIDArray(Counter) = Val(InputBox("Enter a student Id number"))
Counter = Counter + 1 'increment
Loop
Form1.Print " No. "; " Student Name "
Form1.Print "-------"; " -----------------"
For x = 1 To MaxStudent
Form1.Print x & StudentNameArray(x)
Next x
End Sub
No comments have been posted about This will be a useful applicaton for printing a list of student's records on a form.. Why not be the first to post a comment about This will be a useful applicaton for printing a list of student's records on a form..