Membuat Kamus Digital Sunda-Indo Jilid 2

Membuat Kamus Digital Sunda-Indo Jilid 2 - Terusan yang kemarin-kemarin menjelaskan tentang cara-cara menambahkan komponen ke dalam form menu utama. Pertemuan sekarang akan membahas cara pembuatan form Login, dan yang lainnya.

Langkah pertama buka aplikasi VB beserta project kamus yang dulu!
Dan masukan beberapa komponen sesuai gambar berikut :

Menu Login


Ket :

Label 1 | Caption ASUPKEN NGARAN / MASUKAN | Ukuran dan jenis huruf sesuaikan dengan gambar atau sesuai selera si pembuat |

Label 2 | Caption Ngaran / Nama | Ukuran dan jenis huruf sesuai |

Text 1 | Caption kosongkan |

Tombol 1 | Capton kosong | Tambah icon bila perlu |

Adodc 1 |
Sesuaikan propertisnya




Untuk source kodennya sebagai beikut :

Dim isi As Boolean

Private Sub Command1_Click()
On Error Resume Next
If Text1 = "" Then
MsgBox "Silakan masukan nama anda...!!", vbCritical, "Login User"
Text1 = ""
Text1.SetFocus
Else
menu.Show
login.Hide
End If
On Error GoTo 0
End Sub

Private Sub Form_Load()
Text1 = ""
End Sub

Private Sub Text1_keypress(keyascii As Integer)
If keyascii = 13 Then
On Error Resume Next
If Text1 = "" Then
MsgBox "Silakan masukan nama anda...!!", vbCritical, "Login User"
Text1 = ""
Text1.SetFocus
Else
menu.Show
login.Hide
End If
End If
On Error GoTo 0
End Sub

Menu KamusSunda (Terjemahan Sunda Indonesia)

Tampilan formnya

Ket sesuai tampilan form kamussunda:

No 1 Label | Caption Terjemahan Sunda - Indonesia
No 2 Label | Caption Sunda
No 3 Label | Caption Pencarian kata
No 4 Label | Data grid
No 5 Text 1 |
No 6 Label | Caption Indonesia
No 7 Text 2|
No 8 Tombol 1 |
No 9 Text 3 |
No 10 Adodc1 |
No 11 Tombol 2 | Segarkan
No 12 Tombol 3 | Keluar

Source codenya :

Private Sub cmdclear_Click()
Adodc1.Refresh
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
End Sub

Private Sub cmdexit_Click()
Unload Me
menu.Show
End Sub

Private Sub cmdtrans_Click()
Dim sql As String
sql = "SELECT * FROM data_sunda WHERE sunda2 LIKE '" & Text1.Text & "'"
With Adodc1
.RecordSource = sql
.Refresh
If Not (Adodc1.Recordset.EOF And Adodc1.Recordset.BOF) Then
Text2 = .Recordset.Fields("indo")
Else
MsgBox "Data tidak ditemukan", vbCritical, "Translate"
Text1 = ""
Text2 = ""
Text1.SetFocus
End If
End With
Text2.BackColor = &H80000005
Text2.Enabled = True
cmdexit.Enabled = True
cmdclear.Enabled = True
End Sub

Private Sub form_activate()
kamussun.Caption = "Selamat Belajar " + login.Text1
semula
tabel
isi = True
cmdtrans.Enabled = True
Text1.SetFocus
Text1.MaxLength = 30
Text2.MaxLength = 30
Adodc1.Visible = False
grid1.Enabled = True
End Sub
Sub semula()
Adodc1.RecordSource = "select*from data_sunda"
Adodc1.Refresh
Text1.Enabled = True
Text2.Enabled = False
Text3.Enabled = True
Text1 = ""
Text2 = ""
Text3 = ""
Text1.SetFocus
Text1.BackColor = &H80000005 'warna putih
Text2.BackColor = &H80000000 'warna abu2
cmdtrans.Enabled = True
cmdexit.Enabled = True
cmdclear.Enabled = True
End Sub
Sub aktif()
Text1.Enabled = False
Text2.Enabled = True
Text1.BackColor = &H80000000
Text2.BackColor = &H80000005
End Sub
Sub tabel()
grid1.Cols = 3
grid1.Rows = 20
grid1.ColWidth(0) = 200
grid1.ColWidth(1) = 2200
grid1.ColWidth(2) = 2200
End Sub



Private Sub Text1_keypress(keyascii As Integer)
If keyascii = 13 Then
Dim sql As String
sql = "SELECT * FROM data_sunda WHERE sunda2 LIKE '" & Text1.Text & "'"
With Adodc1
.RecordSource = sql
.Refresh
If Not (Adodc1.Recordset.EOF And Adodc1.Recordset.BOF) Then
Text2 = .Recordset.Fields("indo")
Else
MsgBox "Data tidak ditemukan", vbCritical, "Translate"
Text1 = ""
Text2 = ""
Text1.SetFocus
End If
End With
Text2.BackColor = &H80000005
Text2.Enabled = True
cmdexit.Enabled = True
cmdclear.Enabled = True
End If
End Sub

Private Sub Text3_Change()
Adodc1.RecordSource = "select*from data_sunda where sunda2 like '%" & Text3 & "%'"
Adodc1.Refresh
grid1.Refresh
End Sub







Dilanjut ke Membuat Kamus Digital Sunda Indonesia Jilid 3 



Advertisement