coba periksa isi s dengan menambahkan msgbox s di setiap habis pengisian variabel s, untuk memeriksa apakah sintak sql sudah benar.
contoh:
s = "SELECT macter_card.* FROM macter_card WHERE (((macter_card.mc_code)=" & Me!mc_code & "));"
msgbox s
atau kalau perlu coba kopi nilai s dan jalankan di jendela query.
s = "SELECT macter_card.* FROM macter_card WHERE (((macter_card.mc_code)=" & Me!mc_code & "));"
debug.print s 'periksa hasil debug.print di immediate window dg menekan ctrl-g
msgbox s
regards,
aksan kurdin
On 01/07/2014 9:29, Muhamad Safei safeimuhamad@yahoo.com [belajar-access] wrote:
Mau tanya,kira2 apa yang salah ya??
Saya buat save button,kodenya sperti dibawah ini..ketika dijalankan erorr massagenya sperti ini "Too few parameters.expected1"....
s = "SELECT macter_card.* FROM macter_card WHERE (((macter_card.mc_code)=" & Me!mc_code & "));"
Set rs = db.OpenRecordset(s)
If Me!flag = "new" Then
If Not rs.EOF Or Not rs.BOF Then
MsgBox "Mc Code. : " & Me!mc_code & " sudah ada!", vbOKOnly, "Peringatan"
Me!mc_code.SetFocus
Exit Sub
End If
rs.AddNew
End If
If Me!flag = "edit" Then
If Me!Prev <> Me!mc_code Then
If Not rs.EOF Or Not rs.BOF Then
MsgBox "Mc Code. : " & Me!mc_code & " sudah ada!", vbOKOnly, "Peringatan"
Me!mc_code.SetFocus
Exit Sub
End If
End If
s = "SELECT macter_card.* FROM macter_card WHERE (((macter_card.mc_code)=" & Me!Prev & "));"
Set rs = db.OpenRecordset(s)
rs.edit
End If
thnkss
__._,_.___
Posted by: Aksan Kurdin <aksan.kurdin@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
SPAM IS PROHIBITED
.
__,_._,___
Tidak ada komentar:
Posting Komentar