Public Sub ScholarshipLoad()
'Dim txtResult As New TextBox()
Dim strSelected As String = lstApplicant.Items(lstApplicant.SelectedIndex).ToString()
Dim plcHolder, strStanding, strSndStanding As String
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdbPath
Dim strSQL As String = "SELECT * FROM Scholarship WHERE Scholarship.Scholarship=" & "'" & strSelected & "'"
Dim shlDataAdapter As New OleDbDataAdapter(strSQL, strConn)
shlDataAdapter.TableMappings.Add("Table", "Scholarship")
Dim schlDataSet As New DataSet()
shlDataAdapter.Fill(schlDataSet)
Dim schlRow As DataRow
Dim intScholarAmount As Integer
Dim tblScholar As DataTable = schlDataSet.Tables(0)
For Each schlRow In tblScholar.Rows
strStanding = schlRow("Standing")
strSndStanding = schlRow("sndstanding")
If strStanding = "N" Then
strStanding = "Not Require"
End If
If strSndStanding = "N" Then
strSndStanding = "Not Require"
ElseIf strSndStanding = "Above" Then
strSndStanding = "Senior"
End If
If IsDBNull(schlRow("AmntAwarded")) = False Then
intScholarshipAmount = CInt(schlRow("AmntAwarded"))
intScholarAmount = CInt(schlRow("Amount")) - CInt(schlRow("AmntAwarded"))
Else
intScholarAmount = schlRow("Amount")
End If
plcHolder = "Require GPA: " & schlRow("GPA") & vbCrLf & "Require Major: " & schlRow("Major") & vbCrLf & "Must be: " & _
strStanding & " to: " & strSndStanding & vbCrLf & "Total Amount: $" & intScholarAmount
Next schlRow
mtplResult(plcHolder)
End Sub
Public Sub mtplResult(ByRef plcHolder As String)
Dim txtResult As New TextBox()
Dim txtAward As New TextBox()
Dim lblAmount As New Label()
Dim strTextBoxInc As String
Dim strTextBoxResult As String
x = 8
n += 1
If blnSchlTF = True And blnQlfy = False Then
h = 60 'from 50 to 60
x = 8
y = 8
strTextBoxResult = "txtBoxScholarship"
ElseIf blnSchlTF = True And blnQlfy = True Then
If h = 60 AndAlso y = 8 Then
h = 165
x = 8
y = 90 'from 80 to 90
Else
y += 175
End If
strTextBoxResult = "txtQualifiedApplicant"
End If
pnlAppResult.SuspendLayout()
With txtResult
.Name = strTextBoxResult
.Width = 264
.Height = h
.AllowDrop = True
.Location = New Point(x, y)
.AutoSize = True
.Multiline = True
.ScrollBars = ScrollBars.Vertical
.Text = plcHolder
.BackColor = System.Drawing.Color.White
.ReadOnly = True
.Visible = True
.Show()
End With
AddHandler txtResult.DragEnter, AddressOf txtResult_DragEnter
AddHandler txtResult.DragDrop, AddressOf txtResult_DragDrop
pnlAppResult.Controls.Add(txtResult)
pnlAppResult.ResumeLayout(True)
End Sub