Private Sub R_Number()
ClereAllData()
Dim sql_ As String
sql_ = " SELECT MAX(EVENT_ID)+1 AS id FROM TB_EVENTJOBSALE ORDER BY EVENT_ID ASC "
Dim comStr As New OleDbCommand(sql_, OleDbConnection1)
Dim crm As OleDbDataReader = comStr.ExecuteReader
If crm.Read Then
If IsDBNull(crm.Item("id")) = True Then ' ถ้า CustomerID ในดาต้าเบส ว่าง
Txt_Postid.Text = ""
ElseIf IsDBNull(crm.Item("id")) = False Then ' ถ้า CostomerID ไม่ว่าง
Dim Last_CostomerID As String
Last_CostomerID = (crm.Item("id"))
Dim Next_CostomerID As Integer
Next_CostomerID = (Last_CostomerID.Substring(0)) + 1 - 1
Txt_Postid.Text = Next_CostomerID.ToString("00")
End If
End If
End Sub