"The data has been changed" when running a synchronize command

E

erick-flores

Hello all

This is how my code looks:
Private Sub Email_send_report_Click()

CurrentDb.Synchronize ("path")
CurrentDb.Close

Dim stDocName As String

If MsgBox("Make sure your expense report is correct. Once you
click Yes, you will not be able to change any information. Click No to
go back.", vbYesNo, "Submit Report?") = vbYes Then
Me.CHECK = True
Me.Dirty = False
stDocName = "Expense Report"
DoCmd.SendObject acReport, stDocName, "snapshot format"
DoCmd.Close
Else
'do nothing
End If
End Sub

Whats happenin is, I am getting the "The data has been changed"
message when I click on this button. I need to click twice on this
button in order to send the email. 1st click: pop up meesage and 2nd
click: I can send it. I want to be able to send it un the first click.
What is weird ( and I say weird because I have no clue what happenin)
IF I remove these two lines:
CurrentDb.Synchronize ("path")
CurrentDb.Close
from my code everything works fine. But I MUST synchronize before I
send the e-mail.

Can somebody tell me how to get rid off that "The data has been
changed" message I tried to bypass it trapping the error but it didnt
work.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top