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
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