I am trying to get the value from one column in an access table to a variable and display certain things based on what is in that field.
The code I have that is not working is below.
<code>
OrderInfo.Visible = True
OrderInfo.Text = ordersgrid.SelectedItem(1)
medbatch = ordersgrid.SelectedItem(2)
Me.MedinfoDS1().Clear()
If ordersgrid.SelectedIndex <> -1 Then
Me.medinfoda2.SelectCommand.Parameters(0).Value = medbatch
Me.medinfoda2.Fill(Me.MedinfoDS1)
Dim condition As String
condition = MedinfoDS1.Tables(0).Columns("[Time]").ToString
Select Case condition
Case "Amt."
amount.Visible = True
AmountTXTbox.Visible = True
Case "B/P"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "B.S."
amount.Visible = True
AmountTXTbox.Visible = True
Case "LT."
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Pulse"
amount.Visible = True
AmountTXTbox.Visible = True
Case "RATE"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Resp"
amount.Visible = True
AmountTXTbox.Visible = True
Case "Site"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Temp"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
End Select
Label15.Visible = True
Notelbl.Visible = True
reasontext.Visible = True
NoteTxt.Visible = True
End If
End Sub
</code>
The code I have that is not working is below.
<code>
OrderInfo.Visible = True
OrderInfo.Text = ordersgrid.SelectedItem(1)
medbatch = ordersgrid.SelectedItem(2)
Me.MedinfoDS1().Clear()
If ordersgrid.SelectedIndex <> -1 Then
Me.medinfoda2.SelectCommand.Parameters(0).Value = medbatch
Me.medinfoda2.Fill(Me.MedinfoDS1)
Dim condition As String
condition = MedinfoDS1.Tables(0).Columns("[Time]").ToString
Select Case condition
Case "Amt."
amount.Visible = True
AmountTXTbox.Visible = True
Case "B/P"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "B.S."
amount.Visible = True
AmountTXTbox.Visible = True
Case "LT."
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Pulse"
amount.Visible = True
AmountTXTbox.Visible = True
Case "RATE"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Resp"
amount.Visible = True
AmountTXTbox.Visible = True
Case "Site"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
Case "Temp"
BloodPressure.Visible = True
bloodpressuretxtbx.Visible = True
End Select
Label15.Visible = True
Notelbl.Visible = True
reasontext.Visible = True
NoteTxt.Visible = True
End If
End Sub
</code>