Modul – Sistem Warta Penjualan (Vb6)
Untuk membuat modul pada aktivitas Visual Basic 6.0 lakukan dengan perintah berikut :
Click sajian Project pilih Add Module, kemudian tekan ENTER.
Berikut merupakan modul dari sistem informasi penjualan buku :
Function Found(cData As Data, cIndex As String, ctext As String, Status As Byte) As Boolean Found = False
If cData.Recordset.RecordCount <> 0 Then cData.Recordset.MoveFirst
cData.Recordset.Index = cIndex
cData.Recordset.Seek “=”, ctext
If Not cData.Recordset.NoMatch Then
Found = True
Else
If Status <> 1 Then MsgBox “Record ini tidak terdaftar !!!”, , “Record”
End If
End Function
Sub Pindah(KeyAscii As Integer) If KeyAscii = 13 Then
KeyAscii = 0
SendKeys “{Tab}”
End If
End Sub
Function GotoNm(cData As Data, cIndex As String, ctext As String) As Boolean cData.Recordset.Index = cIndex
cData.Recordset.Seek “<=”, ctext & “zzz”
If Not cData.Recordset.NoMatch Then
If Len(Trim(ctext)) >= 30 Then
Beep
End If
End If
End Function
Function GotoKd(cData As Data, cIndex As String, ctext As String) As Boolean cData.Recordset.Index = cIndex
cData.Recordset.Seek “<=”, ctext
If cData.Recordset.NoMatch Then
If Len(Trim(ctext)) >= 5 Then
Beep
End If
End If
End Function