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

Error 2115 when Saving record.

Status
Not open for further replies.

saustin

MIS
Feb 19, 2001
336
US
Hi All,
Have two text box's in an entry form which i am trying to update with data from another table. The data is found and the correct record is displayed in the first text box when Run-time error 2115 pops up with "The macro of function set to the BeforeUpdate or ValidationRule property for this field is preventing MA from saving data in the field"

What's up with this. Have NOTHING in both properties. Has anyone seen this error before ?

Any suggestions Greatly appreciated.
Thanks, Steve.
Here is the code.

Private Sub cboMODEL_AfterUpdate()
Dim newtag As Long

intnewrec = Forms!frmHD8130EX.NewRecord

If intnewrec = True Then

Dim rstMODEL As ADODB.Recordset

Set rstMODEL = New ADODB.Recordset
rstMODEL.ActiveConnection = CurrentProject.Connection
rstMODEL.CursorType = adOpenDynamic

rstMODEL.Open "Select MODEL, MAKE, FAA from tbl8130MODEL WHERE MODEL = '" & Me!cboMODEL.Value & "';"

Debug.Print rstMODEL!MODEL
Debug.Print rstMODEL!MAKE
Debug.Print rstMODEL!FAA

txtMAKE.SetFocus
txtMAKE.Text = rstMODEL!MAKE
' txtMAKE.Value = rstMODEL!MAKE

txtFAA.SetFocus
txtFAA.Text = rstMODEL!FAA
'txtFAA.Value = rstMODEL!FAA

cboMODEL.SetFocus


rstMODEL.Close
Set rstMODEL = Nothing

End If

End Sub
 
It looks like one of your text boxes is bound to an underlying table. Perhaps they should be unbound.

Check the field you're trying to update in the underlying table and make sure there's no validation rule in the fields properties.

Tyrone Lumley
augerinn@gte.net
 
Hi Tyrone,
Thanks for the reply ! Both of them are bound. I want to update their value in NEW RECORDS only.
Is it possible to to bind a text box to and update it's text property ? Or is that my big mistake !
Thanks, Steve.
 
Hi Tyrone,
Thanks for the tip. Funny how this did not appear when I searched knowledgebase.
Solved the problem by changing the text box's to labels and setting their caption properties. No more problemo.
Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top