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!

Microsoft Access cannot find the field "|" referred to in your exp

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
I'm getting this error with this code:

CurrentDb.Execute "INSERT INTO CHILD (Range) VALUES ('" & [RANGETXT].Value & "')"

I'm trying to write data to a field on my table "CHILD" is there something wrong with this code?

Thanks,
 
This control source: =[range].[Column](0,0)

I couldn't get a txt box with what I want in it without making an invisible list box and putting it as the control source on the text box.

This is the rowsource for the listbox that the text box is bound to:

SELECT [MAXX1]-[MINX1] AS Expr1 FROM CHILD, maxx_minx;
 
If you change your code to:

Code:
Dim strSQL As String

strSQL = "INSERT INTO CHILD (Range) VALUES ('" & [RANGETXT].Value & "')"
Debug.Print strSQL
CurrentDb.Execute strSQL

what is displayed in the debug window?

John
 
And i have nothing else open other than my form.
 
Seems like your form is bound to the CHILD table, isn't it ?
I'd use the Recordset property of the form instead of Currentdb.Execute ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Well my main form is bound to a table called NEW_MASTER and i have a subform on it. The record source of the subform is this:

SELECT [CHILD].[x1], [CHILD].[PASS_FAIL], [CHILD].[TEST_TYPE], [CHILD].[LOT_NO], [CHILD].[MODEL_NO] FROM [CHILD]
 
And the recordset type property is set to dynaset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top