Really new and would value any support.
I have 308 buttons on Form1 (Pupilselectform) and each one has a separate textvariable (pupilID) attached to it. When I click on one of the buttons I'd like to open a second form (Pupilview) and run an SQL using the pupilID chosen from Form 1.
Problem is, whilst pupilID(1 to 308) initially populates with the correct numbers they seem to resort to zero after using on button click etc
Why cant I use pupilselectform.pupilid(i) to get a value
This is my code:
Public Sub Button293_click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseClick, Button99.MouseClick, Button98.MouseClick,......... (this list goes on and on - can I shorten it?)
Dim str As String
Dim cvb As Integer
Dim form As New Pupilview()
str = sender.name
tb = CInt(str.Remove(0, 6))
cvb = Pupilselectform.pupilid(tb)
form.Show()
End Sub
I've declared the Array Pupil_ID(308) as public
Thanks
I have 308 buttons on Form1 (Pupilselectform) and each one has a separate textvariable (pupilID) attached to it. When I click on one of the buttons I'd like to open a second form (Pupilview) and run an SQL using the pupilID chosen from Form 1.
Problem is, whilst pupilID(1 to 308) initially populates with the correct numbers they seem to resort to zero after using on button click etc
Why cant I use pupilselectform.pupilid(i) to get a value
This is my code:
Public Sub Button293_click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseClick, Button99.MouseClick, Button98.MouseClick,......... (this list goes on and on - can I shorten it?)
Dim str As String
Dim cvb As Integer
Dim form As New Pupilview()
str = sender.name
tb = CInt(str.Remove(0, 6))
cvb = Pupilselectform.pupilid(tb)
form.Show()
End Sub
I've declared the Array Pupil_ID(308) as public
Thanks