Help, I'm Stuck

littletin
10-27-2000, 11:11 AM
Hi

I'm pretty new to visual basic and I've been experimenting recently. At the moment I'm trying to create a VB program that will search my CD database (Access) using four text box controls where I can enter the search criteria. The CD database only has one table with 5 fields.

I've want to get the number of CD's found to be displayed with their album name in a label. Eg 2Cds Found with the album name "CDTitle1", "CDTitle2".
Mabey I'm in way over my head here but I can't seem to get anywhere. Could anyone give me a hand? Any advice is appretiated.
Thanks Sue

whelanp
10-27-2000, 11:31 AM
My advice would be to play around with some Queries in Access first.

Create a form in Access and use that form to query your CD table (on one or two criterion).

Access Help has some good examples on how this can be achieved.

When you've got that up and running transfering it to VB will be a breeze.

Valkyrie
10-27-2000, 12:24 PM
You can use your text boxes in a "LIKE" clause within your SQL statement
<pre> <green>
SELECT albumname from tblCollection
WHERE albumname LIKE "*" & """ & textbox1 & """ & "*";
</pre></green>

This should return the names of the albums that have the value of textbox1 in the name. If you use the .count property you can get the number of records returned as well.

HTH.

Quote of the moment....
"Ability has nothing to do with opportunity." - Napoleon Bonaparte

littletin
10-28-2000, 05:11 AM
Thank you very much for your help.

Out of curiosity is it possible to do the above but without using SQL queries? For example by using the findfirst, findnext, findlast, etc. How would I go about it?

Again thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum