Urgent Help needed for School Project!! 
Author Message
 Urgent Help needed for School Project!!

I am writing this program for my school project. I am access a database
using the data control. I want the user to type in a word and the program
will display the located word on a label. However I was not able to do
that.Below is a sample of the code I have used. Please Correct the code
if any error is found thank you!!

dim store as string
store = inputbox("enter the word to be searched","Cip Porject")
data1.recordset.findfirst "keyword = 'store'"
label1.caption = data1.recordset.fields("keyword").value

The above code kept displaying a error message
So please help me.
Its urgent!!
Thank you!!!
Please E-mail if possible!!



Sat, 20 Feb 1999 03:00:00 GMT  
 Urgent Help needed for School Project!!


 on Tue, 3 Sep 1996 08:39:12 +0800,
 Tan Tze Yong <Tan> writes:

Quote:

>I am writing this program for my school project. I am access a database
>using the data control. I want the user to type in a word and the program
>will display the located word on a label. However I was not able to do
>that.Below is a sample of the code I have used. Please Correct the code
>if any error is found thank you!!

>dim store as string
>store = inputbox("enter the word to be searched","Cip Porject")
>data1.recordset.findfirst "keyword = 'store'"
>label1.caption = data1.recordset.fields("keyword").value

>The above code kept displaying a error message
>So please help me.
>Its urgent!!
>Thank you!!!
>Please E-mail if possible!!


Try    data1.recordset.findfirst "keyword = '" & store & "'"
What you are doing is searching ALWAYS for the word 'store' in your table.

Welcome to the world of programmers... this is nothing compared with the
errors you will find when you get more experience.

Fernando.



Sat, 20 Feb 1999 03:00:00 GMT  
 Urgent Help needed for School Project!!

Quote:

> I am writing this program for my school project. I am access a database
> using the data control. I want the user to type in a word and the program
> will display the located word on a label. However I was not able to do
> that.Below is a sample of the code I have used. Please Correct the code
> if any error is found thank you!!

> dim store as string
> store = inputbox("enter the word to be searched","Cip Porject")
> data1.recordset.findfirst "keyword = 'store'"

That probably should have been:
   data1.recordset.findfirst "keyword = '" & store & "'"

Quote:
> label1.caption = data1.recordset.fields("keyword").value

> The above code kept displaying a error message
> So please help me.
> Its urgent!!
> Thank you!!!
> Please E-mail if possible!!


--
-----------------------------------------------------------------
Computer analyst to programmer:
            "You start coding.  I'll go find out what they want."
-----------------------------------------------------------------
the Robins Company     http://www.qns.com/~robinson/homepage.html
the VB Resource Index     http://www.qns.com/~robinson/vb/vb.html
the Classified Ads              http://www.the-classified-ads.com
-----------------------------------------------------------------


Sat, 20 Feb 1999 03:00:00 GMT  
 Urgent Help needed for School Project!!

Okej, I'll give it a try!!

Your code:
        dim store as string
        store = inputbox("enter the word to be searched","Cip Porject")
        data1.recordset.findfirst "keyword = 'store'"
        label1.caption = data1.recordset.fields("keyword").value

my code:
        dim store as string
        store = inputbox("enter the word to be searched","Cip Porject")
        data1.recordset.findfirst "keyword = '" & store & "'"
        if not data1.recordset.nomatch then
                'do this if found
                label1.caption = "" & data1.recordset!keyword
        else
                label1.caption = "Not Found"
        end if

Hope this will help!!! It would be fun to know....

Roger



Sat, 20 Feb 1999 03:00:00 GMT  
 Urgent Help needed for School Project!!


<snip>

Quote:
> data1.recordset.findfirst "keyword = 'store'"

data1.recordset.findfirst "keyword = " & "'" & store & "'"

Quote:
> label1.caption = data1.recordset.fields("keyword").value

<snip>

-------------------------------------
Damon



Sat, 20 Feb 1999 03:00:00 GMT  
 Urgent Help needed for School Project!!

I am glad people were willing to help, but does this teach him/her anything
other than, "Hey, if I run into a problem, I'll just ask people to create
code for me on the Internet!"  This is not intended to flame and I am
unaware of Tan's intention, but I think his/her teacher would not be happy
to know that their students are not trying but just asking for help on the
Internet.  Are we establishing a bad precedent?



Sat, 20 Feb 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. school project need help now

2. Need Help on a school project

3. School project help in vb

4. Pleeeeaaase Help... School Project Due

5. School project help in vb

6. school project ... help

7. newbie - need help for timer proj for school

8. I need help for school

9. Help Needed Urgently (for school)

10. {Need Help Big Project Need Help}

11. project for school

12. SCHOOL PROJECT

 

 
Powered by phpBB® Forum Software