M
Michael T
Hello...
I am trying to update a record using input from a form in Access 2003.
When I execute the qrydef I get the message:
"Error number 3066 Query must have at least one destination field."
The SQL string that is Debug.PrintED in code below is:
UPDATE tblDesign SET tblDesign.DesignMonarchSide = 'L',
tblDesign.DesignMonarchFacing = 'L' WHERE tblDesign.DesignName = '2VEENS
JVBIEEE' ;
This looks perfectly correct and when copied into the QBF as SQL and then go
into the design side to execute it, it works perfectly but I cannot get it
to work in VBA. I have tried both double (") and single (') quotes.
Am I missing something obvious?
============================================================
Extract from code below:
strDMS = Mid(Me.DMS0101, 1, 1)
strDMF = Mid(Me.DMS0101, 2, 1)
strSQL = "UPDATE tblDesign " & _
"SET tblDesign.DesignMonarchSide = '" & strDMS & "', " & _
"tblDesign.DesignMonarchFacing = '" & strDMF & "' " & _
"WHERE tblDesign.DesignName = '" & Me.DesignName & "' ;"
Set db = CurrentDb()
Set rec = db.OpenRecordset("tblDesign")
Set qdfTemp = db.CreateQueryDef("", strSQLx)
===============================================================
I then execute the query.
I am trying to update a record using input from a form in Access 2003.
When I execute the qrydef I get the message:
"Error number 3066 Query must have at least one destination field."
The SQL string that is Debug.PrintED in code below is:
UPDATE tblDesign SET tblDesign.DesignMonarchSide = 'L',
tblDesign.DesignMonarchFacing = 'L' WHERE tblDesign.DesignName = '2VEENS
JVBIEEE' ;
This looks perfectly correct and when copied into the QBF as SQL and then go
into the design side to execute it, it works perfectly but I cannot get it
to work in VBA. I have tried both double (") and single (') quotes.
Am I missing something obvious?
============================================================
Extract from code below:
strDMS = Mid(Me.DMS0101, 1, 1)
strDMF = Mid(Me.DMS0101, 2, 1)
strSQL = "UPDATE tblDesign " & _
"SET tblDesign.DesignMonarchSide = '" & strDMS & "', " & _
"tblDesign.DesignMonarchFacing = '" & strDMF & "' " & _
"WHERE tblDesign.DesignName = '" & Me.DesignName & "' ;"
Set db = CurrentDb()
Set rec = db.OpenRecordset("tblDesign")
Set qdfTemp = db.CreateQueryDef("", strSQLx)
===============================================================
I then execute the query.