I get the following error when I try to save data using append query for the save button in the form.
"Microsoft Office Access can't append all the records in the append query"
Here is some detail:
Expand|Select|Wrap|Line Numbers
- Private Sub btnSaveToDatabase_Click()
- Dim strSubcontractNumber As String
- Dim strSCNJTag As String
- Dim strSCNJ As String
- strSubcontractNumber = txtSubcontractNumber.value
- If (txtSCNJTag.value >= 100 And txtSCNJTag.value < 999) Then
- strSCNJTag = txtSCNJTag.value
- End If
- strSCNJ = strSubcontractNumber & "-SCNJ" & "-" & strSCNJTag
- MsgBox "You are about to add " & strSCNJ & " to the database. Press OK to proceed.", vbOKCancel, "Adding to database..."
- DoCmd.SetWarnings False
- DoCmd.OpenQuery "app_AppendCurrentSCNJ"
- DoCmd.OpenQuery "app_AppendCurrentCostAnalysis"
- DoCmd.OpenQuery "app_AppendCurrentDocuments"
- DoCmd.SetWarnings True
- End Sub
When I click save button on the form it says ok . But the record I saved is not there in the following table and when I checked datasheet view in query is shows new record with same SCNJCounter value. when I try to run the query it returns the error above.I know records are not saved in table because SCNJCounter is not incrementing but don't get why.
Your help will be greatly appreciated.
Thank you in advance...