PC Review


Reply
Thread Tools Rate Thread

simple code error on openRecordset cmd

 
 
jeff moore
Guest
Posts: n/a
 
      1st Aug 2003
every thing works right up to the last statment, where i
get a "Data type mismatch in criteria expresion" error.
run time error 3464. I have all the nessecary dao libaries
enabled. the code is identical to code in a different
database that does run. the SQL query runs fine on its
own. the var prodcode = 11166 and the SQL statement
returns SYCAMORE. TIA Jeff

Dim db As Database
Dim SQL As String
Dim rs As Recordset
Set db = CurrentDb()
Dim Prodcode As String
Prodcode = Me![WFCProdCode].Text
MsgBox Prodcode
SQL = "SELECT [Product].[CustAbrev]FROM Product WHERE
((([Product].[ProdCode])='" & Me![WFCProdCode].Text
& "'));"
MsgBox SQL
Set rs = db.OpenRecordset(SQL)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Error 1004) Object Defined Error ...simple code Robert Crandal Microsoft Excel Programming 1 12th Jan 2010 11:31 PM
error 9 - simple code PBcorn Microsoft Excel Programming 10 30th May 2008 04:13 PM
Error in code - never been there before - set RS as openrecordset( BlueWolvering Microsoft Access VBA Modules 4 4th Mar 2008 02:20 PM
Access 97 code openrecordset problem Bob Microsoft Access 1 1st Nov 2005 07:29 PM
Simple code error statement Stuart Microsoft Excel Programming 7 3rd Mar 2004 09:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.