kiengxuong > 24-06-15, 02:15 PM
(23-06-15, 10:12 AM)Noname Đã viết:Cảm ơn bạn đã trả lời mình nó báo lỗi(22-06-15, 06:12 PM)kiengxuong Đã viết: Xin chào mọi người mình làm giống bạn đã chạy ok trên file acc bình thường nhưng khi mình cho table tblLuuVetChuongTrinh lên sql rồi mình link table tới sql nó báo lỗi ở phần code
Function CapNhatLuuVet(fUserName, fOldValue, fNewValue, fControlName, fFormName)
Dim DB As DAO.Database
Dim rst As DAO.Recordset
Set DB = CurrentDb
Set rst = DB.OpenRecordset("tblLuuVetChuongTrinh", dbOpenSnapshot)
rst.AddNew báo lỗi
rst!TenUser = fUserName
rst!GiaTriCu = fOldValue
rst!GiatriMoi = fNewValue
rst!TenControl = fControlName
rst!TenForm = fFormName
rst!NgayCapNhat = Date
rst!GioCapNhat = time()
rst.Update
rst.Close
Set rst = Nothing
Set DB = Nothing
End Function
mong bạn chỉnh sửa giúp mình Cảm ơn bạn rất nhiều
khongventoan@gmail.com
Nó báo lỗi gì vậy bạn?
Đối với table dạng link, nếu bạn muốn thêm xóa sửa thì truyền đối số là dbOpenDynaset
Nếu chỉ muốn truy vấn (như dlookup) thì dùng dbOpenSnapshot sẽ cải thiện tốc độ.