Hello once again!
I am trying to add data from unbound text boxes to a sub-form but I get runtime 3022. Maybe you guys know why?
Can you see anything wrong with the code below?
Red box contains my unbound text which by pressing "Enter Audit into History" button it's supposed to populate sub-form below.
Field values in the code are correct, btnAddAudit is the "Enter Audit into History" button.
If you need to see other parts of my database please let me know.
I am trying to add data from unbound text boxes to a sub-form but I get runtime 3022. Maybe you guys know why?
Can you see anything wrong with the code below?
Next, here is the sub-form SQLOption Compare Database
Private Sub btnAddAudit_Click()
With CurrentDb.OpenRecordset("tblWIAudit")
If Not .BOF And Not .EOF Then
.MoveLast
.MoveFirst
'Add a new one
.AddNew
![fldAuditID] = Me.fldDocID
![fldAuditType] = fldAuditType.Value
![fldAuditDate] = fldAuditDate.Value
![fldAuditNotes] = fldAuditNotes.Value
![fldAuditByID] = fldAuditByID.Value
.Update
End If
End With
' Requery
DoCmd.RunCommand acCmdSaveRecord
subFrmWIAudit.Requery
End Sub
Main formSELECT *
FROM tblWIAudit
ORDER BY tblWIAudit.fldAuditDate DESC;
SELECT A.*, B.fldSectionName AS [Section], [C_1].[fldFirstName] & " " & [C_1].[FLDLASTNAME] AS Owner, [C_2].[fldFirstName] & " " & [C_2].[FLDLASTNAME] AS [Approving Authority], tblWIProcess.fldProcessID
FROM (((tblWI AS A LEFT JOIN tblSection AS B ON A.fldSectionID = B.fldSectionID) LEFT JOIN tblMember AS C_1 ON B.fldDocOwner = C_1.fldMemberID) LEFT JOIN tblMember AS C_2 ON B.fldAppAuth = C_2.fldMemberID) INNER JOIN tblWIProcess ON A.fldProcessID = tblWIProcess.fldProcessID;
Red box contains my unbound text which by pressing "Enter Audit into History" button it's supposed to populate sub-form below.
Field values in the code are correct, btnAddAudit is the "Enter Audit into History" button.
If you need to see other parts of my database please let me know.