hi guys,
i have a separate button to update the record, but when i run or click the cmdUpdate button it gives me an error;
code below is the one i'm working thru.
Private Sub cmdUpdate_Click()
strSQL1 = "UPDATE tblAMHMace " & _
" SET ReferenceNo=" & Me.txtReferenceNo & "'" & _
", DateLog='" & Me.txtDate & "'" & _
", DocType='" & Me.txtDocType & "'" & _
", Subject='" & Me.txtSubject & "'" & _
", Recipient='" & Me.txtRecipient & "'" & _
", Company='" & Me.txtCompany & "'" & _
", Initiator='" & Me.cboInitiator & "'" & _
", Status='" & Me.cboStatus & "'" & _
", PreparedBy='" & Me.txtPreparedBy & "'" & _
", WHERE ReferenceNo=" & Me.txtReferenceNo.Tag
If Me.txtReferenceNo.Tag & "" = "" Then
MsgBox "Record exist", , ""
Else
rs.Edit
db.Execute strSQL1, dbFailOnError
rs.Update
rs.MoveNext
MsgBox "Record has been updated...", vbInformation + vbOKOnly, "Database Information"
DoCmd.Close acForm, Me.Name
End If
End Sub