2016-12-17 17 views
0

は、私はこのタイプ不一致VSFlexGrid VB6

If EditData = False Then 
     'Simpan data 
     If Grd_StatUjian.TextMatrix(Grd_StatUjian.RowSel, 2) > 30 Then 
     MsgBox "Sesi Tersebut Sudah Penuh... Silahkan Cari Sesi Lainnya...!", vbInformation, "Informasi" 
     Else 
     cn.Execute "INSERT INTO ujian_mhs VALUES ('" & 0 & "','" & TBox(0).Text & "','" & cb_sesi.Text & "','" & cb_hari.Text & "','" & TBox(3).Text & "','" & TBox(5).Text & "','" & cb_ujian.Text & "','" & frmBack.lbta.Caption & "')" 
     End If 
    Else 
     'Update data 
     cn.Execute "UPDATE ujian_mhs SET sesi_ujian='" & cb_sesi.Text & "',hari_ujian='" & cb_hari.Text & "',kd_instruktur='" & TBox(5).Text & "'" & _ 
        "WHERE NPM='" & TBox(0).Text & "'" 
    End If 

のような問題を抱えていることは、特に、このコードの一部では、「型の不一致」を示しています

If Grd_StatUjian.TextMatrix(Grd_StatUjian.RowSel, 2) > 30 Then 

あなたは間違って何を教えてもらえますか? ありがとうございます

答えて

1

Grd_StatUjian.TextMatrixは整数を比較しています。 linkを参照してください。 文字列のチェックに数値以外のデータを追加することを忘れないでください。

If CInt(Grd_StatUjian.TextMatrix(Grd_StatUjian.RowSel, 2)) > 30 Then