LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default sql stmt issue

I'm trying to update a field (NOTES) in my Access database with 2 sql
statements. The statements are as follows"

Sql = "UPDATE [Data_Current] set [NOTES] = """ & tmpcom & """ where [GP] =
""" & vGroup & """ AND [BR] = """ & Cells(r, 2) & """ AND [CUST_NO] = """ &
Cells(r, 3) & """ AND [SOURCE] = """ & Cells(r, 6) & """ AND [DATE] = """ &
tmpAll & """ AND [BALANCE] = '" & vBal & "'"

Call Recordset.Open(Sql, ConnectionString, adOpenForwardOnly,
adLockReadOnly, CommandTypeEnum.adCmdText)

With these statements, I'm getting a "data type mismatch in criteria
expression" error. I believe the issue has to do with the balance field
because when I run it without the balance criteria, the sql statement works.

GP, BR, CUST_NO, SOURCE, and DATE are all text fields in the Access database.

BALANCE is defined as currency in the Access database. The variable vBal is
dimmed as a currency variable at the beginning of the module.

The only difference I see is in the Access database, BALANCE is displayed as
$29.04. When I move the cursor over vBal, the amount is displayed as 29.04.

I'd appreciate any help getting these statements to work. Thanks.....
--
JT
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
LOOKUP or IF-THEN stmt - which one? JessP27 Excel Worksheet Functions 8 June 1st 09 04:51 PM
Getting error using if then else stmt ub Excel Worksheet Functions 2 September 24th 07 10:48 PM
Rounding down from .9 in an IF stmt GenaM Excel Worksheet Functions 1 August 2nd 06 11:16 PM
if stmt trouble vencopbrass Excel Discussion (Misc queries) 2 February 25th 06 10:57 AM
URGENT need help with if/then stmt. Melissa H. Excel Worksheet Functions 4 October 26th 05 10:08 PM


All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"