Error 2465

thirty

Registered User.
Local time
Today, 12:26
Joined
Dec 10, 2012
Messages
10
I am getting the error 2465 in the program below.
Error discription: "can't find the field '|1' referenced to in your expression"

Here is a part of the program

Dim strMySql_zoekenOpId As String
Dim strTitel As String

strTitel = "DVD-LIJST"
strMySql_zoekenOpId = "SELECT tbldrager.Id, tbldrager.Naam, tbldrager.Soort, tbldrager.Aantal, tbldrager.Formaat, tbldrager.Kostprijs, tbldrager.LEVERANCIER, tbldrager.Verpakking " & _
"FROM tbldrager " & _
"WHERE (((tbldrager.Id)=" & [Formulieren]![frm_gegevensinvoer]![txtId] & ")) " & _
"ORDER BY tbldrager.Naam DESC"

Dim myCnn As ADODB.Connection
Set myCnn = CurrentProject.Connection
Dim Sqltabeldrager As New ADODB.Recordset
Sqltabeldrager.ActiveConnection = myCnn
Sqltabeldrager.Open strMySql_zoekenOpId, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Sqltabeldrager.MoveFirst

If Not Sqltabeldrager.BOF And Not Sqltabeldrager.EOF Then
Me.txtTitel = Sqltabeldrager.Fields(1)
Me.cboLeverancier = Sqltabeldrager.Fields(6)
Me.cboScherm = Sqltabeldrager.Fields(4)
Me.txtAantal = Sqltabeldrager.Fields(3)
Me.txtKostprijs = Sqltabeldrager.Fields(5)
Me.cboVerpakking = Sqltabeldrager.Fields(7)
Me.cboSoort = Sqltabeldrager.Fields(2)
Else
MsgBox "Dit ID komt niet in de lijst voor", vbOKOnly + vbInformation, strTitel
End If

Sqltabeldrager.Close
Set Sqltabeldrager = Nothing
Set myCnn = Nothing


When i change the red text by a number ex. 14, it is working.

Thanks in advance
 
Before executing try a debug.print..
Code:
Debug.Print [COLOR=SeaGreen][COLOR=Red][Formulieren]![frm_gegevensinvoer]![txtId]
See if the value id actually present.. Also should it not begin with Froms![/COLOR][/COLOR][Formulieren]![frm_gegevensinvoer]![txtId]
 
That is it.

I changed the dutch word "formulieren" bij the english word "Forms"
It works!

Thanks alot.
 

Users who are viewing this thread

Back
Top Bottom