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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA error when trying to save access data

Status
Not open for further replies.

ShaneJones

Programmer
May 6, 2002
6
US
I am using VB to auto-complete a variety of text fields with other fields in the database. If you are still with me, I have delcaired all the varialbes, set them to the fields, and them set them in the remaining text. When I attemp to complete the merge, I get the following error:

Run-time error 7878
The data has been changed.

I would like to know what save procedure I need to use to get rid of this error. Or is this not even my problem??

Thanks for the help.
 
Shane,

Suggest you publish your code so that I/someone can have a look at it. You hav'nt really provided enough info,

Cheers,
Steve
 
Here's the partial code I have done. I have excluded the multiple variables and definitions to save space.

Code:
'Define variables
Dim PitiAmt As String

'Set variables
subfrmBuyerFinInfo!PITIPmtAmtb.SetFocus
PitiAmt = subfrmBuyerFinInfo!PITIPmtAmtb.Text

'Combine variables with text and input into textbox
subfrmBuyerTerms!Btermsexplained.SetFocus
subfrmBuyerTerms!Btermsexplained.Text = "Monthly payments of " + PitiAmt + " principal and interest monthly are due by  the " + Day1 + " of each month with first payment due on " + Day2 + ".   Interest Rate is " + Interest2 + " and interest begins on " + Possession + ".  Buyers are to obtain a mortgage immediately, but if cannot, buyers will have 12 months to pay off seller from this date.  Buyers are to be responsible for all costs of securing a new mortgage."

Any help would be great. Thanks
 
I think I know whats wrong....I've done it before myself. Try replacing the + signs with & symbols.
 
I can change the + signs to & symbols, but I still get the error about data being changed.
I am using the
Code:
DoCmd.RunCommand acCmdSaveRecord
command to save, is that part of my problem?
 
Shane,

You dont say where about you are triggering the above code from. Is it from a Form or a control event, or what?

The DoCmd.RunCommand acCmdSaveRecord could be part of the problem. Again, where is it being called from. Generally speaking, it would be OK coded against a button on the form, but could cause problems coded against some of the form events.

Can you save the record successfully if you press the record selector bar?

Cheers,
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top