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

Object Required 1

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
HI Guys,

I'm getting an "Object Required " error message with the last part of the code:

Dim strSQL As Variant

strSQL = "DELETE tblQuery.EnQuiryID, tblQuery.RecordId, * " & _
"FROM tblQuery " & _
"WHERE tblQuery.EnQuiryID =" & [Forms]![formQuerymain]![FormQueries]![Text3] And tblQuery.RecordId = " & [Forms]![formQuerymain]![FormQueries]![Text3]"

CurrentDb.Execute strSQL, dbFailOnError

Can anyone see why.
 
Quotes in the wrong place
Code:
"WHERE tblQuery.EnQuiryID =" & [Forms]![formQuerymain]![FormQueries]![Text3] & " And tblQuery.RecordId = " & [Forms]![formQuerymain]![FormQueries]![Text3]
 
Thanks Golom,
Your code worked fine.

Dim strsql As Variant

strsql = "DELETE tblQuery.EnQuiryID, tblQuery.RecordId, * " & _
"FROM tblQuery " & _
"WHERE tblQuery.EnQuiryID =" & [Forms]![formQuerymain]![FormQueries]![Text3] & " And tblQuery.RecordId = " & [Forms]![formQuerymain]![FormQueries]![Text4]

CurrentDb.Execute strsql, dbFailOnError

and it was text4 not text3 for the last control :~/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top