473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

VB6 Reading Mdb query specific item

104 100+
Hi all, I have a mdb with a query called ReportQ, it has 2 columns namely Tel2 and Sum Of knowledge and the querry looks like this:

Tel2 ...... Sum of Knowledge
1................. 100
2................. 325
3 ................. 243
etc.

Please could someone check my code to see where i have gone wrong as my result gives "false" as the answer.

All I want is to lookup in the query (ReportQ in mdb)
where Tel2 = 1 to give me the result of 100
or Tel2 = 2 to give me 325
etc.

VB6 Code :
mthrep.TextArray(8) = Adodc1.RecordSource = "Select * From ReportQ Where Sum Of Knowledge LIKE Tel2 = 1"

Thanks so much
Werner
Jun 11 '09 #1
4 2074
MikeTheBike
639 Expert 512MB
@Wernerh
Hi

"Select [Sum Of Knowledge] From ReportQ Where Tel2 = 1"

Is that what you mean?

(assuming Tel2 is numeric?)

MTB
Jun 11 '09 #2
Wernerh
104 100+
Hi MTB,

Yes both fields are numeric. Tel 2 is essentially a lookup code and Sum of ..... is the result of a few tables against that code. So I have code 1-62 under Tel2 and the totals from the tables relevant to the individual codes as a single entry in this query. Does that make sense?

Thanks
Werner
Jun 11 '09 #3
Wernerh
104 100+
I have placed the brackets as you have indicated and still getting "False" as result in my datagrid
Jun 11 '09 #4
daniel aristidou
491 256MB
um i just got a question why are you looking up in another query, is it not possible to create a single query rather than multiple queries,
Select * From ReportQ Where [Sum Of Knowledge] LIKE Tel2 = 1"
Which you are at the moment.
And secondly im no expert in sql but from what i know it seems u have 2 conditions. you are asking it to tell you if the [Sum of knowledge] is like TEl2 .... When Tel2 is equal to 1- If that is what you intend to achieve why not simply use:

Expand|Select|Wrap|Line Numbers
  1. Select * From ReportQ Where [Sum Of Knowledge] LIKE 1"
.

Hope that might help
Jun 11 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bernie | last post by:
Greetings, I have 3 servers all running SQL Server 2000 - 8.00.818. Lets call them parent, child1, and child 2. On parent, I create a view called item as follows: CREATE view Item as...
3
by: Chuck | last post by:
Hi, I have a somewhat unique problem (at least unique to me, and I've been doing this for longer than I care to admit). I have a client that needs to print cards onto perforated card stock (so...
2
by: rjameel67 | last post by:
Hi All, I am new user of Access database. Need help to create an expression to filter out specific item #. The query contains two field: 1) store number 2) item number - the item# are 15...
2
by: Thief_ | last post by:
I'm using the following code to read in a web page as HTML: ' Download the web page using the chosen update method. Dim sr As New...
9
by: Jimbo | last post by:
Hello, I have a user request to build a form in an Access database where the user can check off specific fields to pull in a query. For example, let's say I have 10 fields in a table. The user...
2
by: AZKing | last post by:
Hi, I am creating a query where I would like to count the number of specific items in a certain column of another query. I can do this for one item, for example: SELECT DISTINCTROW., Count(.)...
2
by: dauwe.peter | last post by:
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr, cddatein, cddateout, dvd nr, dvddatein, dvddateout. I would like a query where a see the personsname en de last book with the...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
5
by: ashraf02 | last post by:
Hi i am trying to execute the following query and is coming up with the above error: the specific code of the query is in bold text. i have put the rest of the code just in case there is something...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.