Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I override an Access Message 1

Status
Not open for further replies.

121854

MIS
Aug 2, 2003
60
0
0
US
I have the code below and when it executes access display "Microsoft Access can't append all the records in the append query". Does anyone know how to eliminate this problem and display your own message. I also have the same problem when I have an sql query to add a record.

Guidance will be nice.

Dim sql2 As String
sql2 = "Update Contacts Set " _
& "CompanyName=" & Me.CompanyName.Value _
& "," _
& "TypeOfService=" & """" & Me.Combo5.Value & """" _
& "," _
& "InvoiceNumber=" & Me.InvoiceNumber.Value _
& "," _
& "ContactPerson=" & Me.ContactPerson.Value _
& "," _
& "Notes=" & Me.Notes.Value _
& "," _
& "DateOfService=" & "#" & Me.DateOfService & "#" _
& "," _
& "Amount=" & Me.Amount _
& " " _
& "Where SupplierID=" & Me.SupplierID.Value & ";"

varsql = sql2

DoCmd.RunSQL sql2, 0

 
On Error GoTo LableName
sql2 = "Update........."
DoCmd.SetWarnings False
DoCmd.RunSQL sql2, 0
DoCmd.SetWarnings true
Exit Sub

LableName:
if err.number = <your error code> then
msgbox "Your Message"
Exit Sub
endif
 
The suggestions works great. However, know I'm getting a different message:"Write Conflict - The record has been added change by another user since you started editing If you save the record, you will overwrite the changes the other user made. .... then there are buttons that say DROP CHANGES, SAVE CHANGES Or COPY TO CLIPBOARD".

Do you know how can I surpass this problem? I'm the only user.

Your advise will be appreciated.
 
This message comes when the same record is open in another form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top