Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Query statement in Excel


I was trying to find a record in the Access database from
my excel sheet. I manage to connect to the database
successfully and come out with the query string. but when
i run the code I can't find the record from the database,
in fact the record is in. In the database, the data type
for each field a
Field Datatype
Counter Text
Date Date/Time
Volume Number
Unit Price Number

Below is my code:
-----------------------------------------------------------
Set db = OpenDatabase("D:\Profiles\csl096c\My
Documents\Personal\OwnFiles\db1.mdb")
Let strQueryString = "SELECT * FROM Sell " & _
"WHERE Counter LIKE '" & strCounter & _
"' AND Date LIKE '" & strDate & _
"' AND Volume = " & Val(strVolume) & _
" AND [Unit Price] = " & Val(strUnitPrice)

Set rstSell = dbKlse.OpenRecordset(strQueryString)

-----------------------------------------------------------

can somebody please point out to me what possible i did
wrong or i didn't do. Please help. Many Thanks in advance..

Thanks,
SB
Reply
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
Writing an IF statement in Microsoft Query JTurner Excel Worksheet Functions 6 March 30th 10 02:55 AM
IF Statement Query MissV Excel Worksheet Functions 5 May 27th 08 09:42 AM
If statement query Rajula Excel Worksheet Functions 3 April 20th 07 11:14 AM
IF statement query shakey1181 Excel Discussion (Misc queries) 2 November 8th 06 03:17 PM
IF statement query JaB Excel Worksheet Functions 5 September 27th 06 04:34 PM


All times are GMT +1. The time now is 04:50 AM.

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

About Us

"It's about Microsoft Excel"