나는오류 3251 내가 현재 MS-액세스 2010 데이터베이스에 감사 추적을 추가하는 작업입니다
이내 감사 추적 모듈의 코드, 주로 코드를 웹에서 오는 배치추적하려는 양식의 이벤트.고민하고 이 기능은,571,416,994,142에 호출
Public Function auditChanges(RecordID As String, userAction As String, cForm As Form) Dim db As DAO.Database Dim rst As DAO.Recordset Dim ctl As Control Dim userLogin As String Set db = CurrentDb Set rst = db.OpenRecordset("SELECT * FROM T_AUDIT") userLogin = getCurrentUser Select Case userAction Case "New" With rst .AddNew ![Date] = Now() ![utilisateur] = userLogin ![nomFormulaire] = cForm.Name ![Action] = userAction ![RecordID] = cForm.Controls(RecordID).Value .Update End With Case "Delete" With rst .AddNew ![Date] = Now() ![utilisateur] = userLogin ![nomFormulaire] = cForm.Name ![Action] = userAction ![RecordID] = cForm.Controls(RecordID).Value .Update End With Case "Edit" For Each ctl In cForm.Controls If (ctl.ControlType = acTextBox) Or (ctl.ControlType = acComboBox) Or (ctl.ControlType = acCheckBox) Then If (Nz(ctl.Value, "") <> Nz(ctl.OldValue, "")) Then With rst .AddNew ![Date] = Now() ![utilisateur] = userLogin ![nomFormulaire] = cForm.Name ![Action] = userAction ![RecordID] = cForm.Controls(RecordID).Value ![champs] = ctl.ControlSource ![ancienneValeur] = ctl.OldValue ![nouvelleValeur] = ctl.Value .Update End With End If End If Next ctl End Select rst.Close db.Close Set rst = Nothing Set db = Nothing End Function
: 여기
바운드 텍스트 상자를 편집하려고하면 오류가 발생합니다. 그리고
If (Nz(ctl.Value, "") <> Nz(ctl.OldValue, "")) Then
라인은 오류를 유발하는 라인입니다
이 양식은 일대 다 관계로 연결된 2 개의 테이블을 기반으로합니다. 이 함수는 테이블의 "One"부분에있는 필드를 편집 할 때 작동하지만 "Many"면의 필드를 편집 할 때 오류가 발생합니다. 자세한 내용
내 폼이 그 요청을 기반으로합니다 : 오류가 T_PROPOSITION.reference_simple
컨트롤에서 해고
SELECT T_REVISION.ID_revision, T_REVISION.fk_ID_proposition, T_REVISION.numero, T_REVISION.fk_etat_revision, T_REVISION.EOTP, T_PROPOSITION.reference_simple, T_PROPOSITION.libelle, T_REVISION.description_localisation
FROM T_PROPOSITION INNER JOIN T_REVISION ON T_PROPOSITION.ID_proposition = T_REVISION.fk_ID_proposition
ORDER BY T_REVISION.numero DESC;
내가 충분히 명확 나는 희망
, 당신에게
편집 감사합니다. 내가 T_REVISION.EOTP, T_REVISION.description_localisation 필드를 편집하려고 : 때 오류 3251 는을 발생합니다. 내가 T_PROPOSITION.reference_simple, T_PROPOSITION.libelle을 편집 할 때 오류 3251가 발생하지 않습니다!
그래서 : 관계의 "한"측면에서 오는 값을 편집하지만 난 "많은"을 편집 할 때 내가 oldValue입니다 재산
에게 액세스 할 수없는 것 같다 옆으로 수 I'am 이 문제를 어떻게 해결할 수 있습니까?
오류가 발생한 행을 표시하면 도움이됩니다. –
죄송합니다. \t 오류 3251을 실행하는 줄은'If (Nt (ctl.Value, ") <> Nz (ctl.OldValue,"))입니다. Then' – LostReality
"많은" 사이드 필드? – dbmitch