I have table named studentlogs, and it has column status on it. When I finished inserting records on student logs, I want to use an if .. else statement. The status column can only have 3 values: 1, 2 or 3.

Now, I want to do the following after I insert the records:

if status="1" then
   CALL SENDSMS()
ENDif
if status="2" then
   msgbox("")
ENDif
if status="3" then
   msgbox("")

How can I do it when I am dealing with columns?

To get the value of a row in a specific column, you can use parenthesis right after the row object and specify the ColumnName or ColumnIndex property to get the value.

Also, when there is more than one potential value, you can ue a case statement, instead of a lot of ElseIf statements.

MVCE Setup

'declare local variables
Dim dr As DataRow

'create table
Dim studentLogs As New DataTable("StudentLogs")

'add columns
With studentLogs
    .Columns.Add("Status", GetType(Integer))
    .Columns.Add("OtherCol1", GetType(String))
End With

'add values
With studentLogs
    dr = studentLogs.NewRow()
    dr("Status") = 1
    dr("OtherCol1") = "Joey"
    studentLogs.Rows.Add(dr)
End With

Check Column Value / Row Status

For Each row As DataRow In studentLogs.Rows
    Select Case row("Status")
        Case 1
            Call SENDSMS()
        Case 2
            MsgBox("2")
            Exit For
        Case 3
            MsgBox("3")
    End Select
Next