Ms Access - Menambahkan Data (Record) Secara Otomatis kedalam Value List
Access -
' Add Record to The Row Source "Value List"
' Use this code in the On Click event of the button:
' Source: https://www.access-programmers.co.uk/forums/threads/adding-items-to-a-listbox.224682/
'Code:Copy to clipboard
If Nz(Me.txtZipCode2, "") <> "" Then
If MsgBox("Add '" & Me.txtZipCode2 & "' to list?", vbYesNo, "Confirmation Required") = vbYes Then
Me.lstZipCollection.RowSource = Me.lstZipCollection.RowSource & Me.txtZipCode2 & ";"
Me.lstZipCollection.Requery
End If
End If
' This needs to be copied to the form's code module. Double click the button while the form is in design mode and find the Button's On Click event. Select [Event Procedure] then click the elipse ... to the right. This will open the code module.
' The code goes between the lines
Private Sub btnEnter_Click()
'Put code here.
End Sub
' Untuk menghapusnya gunakan code berikut:
Use this code:
Code:Copy to clipboard
If MsgBox("Clear List?", vbYesNo, "Confirmation Required") = vbYes Then
Me.lstZipCollection.RowSource = ""
Me.lstZipCollection.Requery
End If
in the On Click event of a new button.
Metode lainnya adalah sbb:
Memasukkan Data ke dalama table. Bukan kedalam "Value List"
ini memerlukan tiga hal:
1. Tombol1 : cmdStatus
2. Tombol2 : cmdAdd
3. textBox : txtstatus
Catatan:
tblProcess hanya berisi satu Field saja (type: text) dengan nama field-nya adalah Process
Private Sub cmdstatus_Click()
If Me.txtstatus.Visible = True Then
Me.txtstatus.Visible = False
Me.cmdAdd.Visible = False
Else
Me.txtstatus = ""
Me.txtstatus.Visible = True
Me.cmdAdd.Visible = True
End If
End Sub
'----
Private Sub cmdAdd_Click()
Dim rs As Recordset
If IsNull(Me.txtstatus) = True Or Len(Me.txtstatus) = 0 Then Exit Sub
Set rs = CurrentDb().OpenRecordset("Select * from tblProcess where Process='" & Me.txtstatus & "'")
If rs.RecordCount > 0 Then
MsgBox "Exist in the Database " & Me.txtstatus & " Please Change"
Else
rs.AddNew
rs.Fields(0) = Me.txtstatus
rs.Update
Me.Process.SetFocus
Me.txtstatus.Visible = False
Me.cmdAdd.Visible = False
Me.Refresh
End If
Set rs = Nothing
Kode Info saja:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strmsg As String
strmsg = "Data has been changed."
strmsg = strmsg & " Save this record?"
If MsgBox(strmsg, vbYesNo, "") = vbNo Then
DoCmd.RunCommand acCmdUndo
Else
End If
End Sub
Database Training Attendance
Kami bergerak dalam pembuatan Website Kantor, Toko Online, MS Access Database, Desain Grafis (Corel Draw & Photoshop), Gambar Teknik, Video Maker, Penjualan Laptop & PC dan lain-lainya
Terimakasih Atas Kunjungan Anda.
Jasa Pembuatan Database Microsoft Access
(Hubungi WA: +6281277403909)
Database Perpustakaan (Library)
Database Link To File and Folder
Database Training Member
Database Daftar Anggota Koperasi
Daftar Link Ke Postingan Forum Online (Internet)
Daftar Kuis Bank Soal Pokok Bahasan Daftar Pertanyaan Tipe B
Database Daftar Transaksi Keuangan
Database Nomor Kontak
Contoh Pengunaan Query Untuk Menentukan
Ranking Terbanyak
Mahanila Engineering Group. Spesialis Dalam Pembuatan Database Microsoft Access
Promo Sampai Jun 2017
Hubungi Kami:
Mahanila Das - Founder
0812-7740-3909 (HP dan WA)
0819-9109-9321 (HP)
Susanti - Marketing Manager:
0813-8014-2808 (HP)
0819-9108-4996 (HP dan WA)
ini adalah contoh database yang dapat menyimpan ribuan Link ke Files atau Folder dan juga menyimpan Alamat Website
Contoh Desain Sertifikat Dengan Menggunakan Corel Draw.
Mahanila Das - Director
0812-7740-3909 (HP dan WA)
0819-9109-9321 (HP)
Marketing Manager: Susanti
HP
0813-8014-2808 (HP)
0819-9108-4996 (HP dan WA)
Mahanila Engineering Menerima:
Spanduk, Banner, Sertifikat, Poster, Cover Buku dan Majalah, Brosur, Kartu Nama, Undangan, Logo, Bros, Pin, Neon Box, Sticker, Database Ms Access, Website, Blog, Desain Rumah Tinggal, Konstruksi Bangunan
Hubungi:
Mahanila Das (I Wayan Mesra Ariyawan).
HP/WA 0812-7740-3909