Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 10:09 PM
432097 members and 299075 Topics
Latest Member: franeme
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl  (Read 84 views)
howard m
Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
« on: November 01, 2009, 10:39 PM »

kindly assist,
i enter the search criteria in a text box linked to a field(name of student) in the table
i want to send data to a label linked to another field(age)from d table,such that once i click the get cmd button in my application the data i need corresponding to the search criteria entered in the txt box would appear,
sweet_pawn
Re: Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
« #1 on: November 02, 2009, 07:55 AM »

Put another textbox, label, and button on d form.
Bind the label to the field you are searching on,eg. name.
Do not bind the text box.
Put this in button click event:
data1.findfirst "name = "&text1.text
Rem You can replace name with the fieldname of d D.B u are searching on.

If data1.nomatch= true then
msgbox " No Match Found!"
End If

Type your query in the textbox and click on the button.
sweet_pawn
Re: Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
« #2 on: November 02, 2009, 07:55 AM »

Put another textbox, label, and button on d form.
Bind the label to the field you are searching on,eg. name.
Do not bind the text box.
Put this in button click event:
data1.findfirst "name = "&text1.text
Rem You can replace name with the fieldname of d D.B u are searching on.

If data1.nomatch= true then
msgbox " No Match Found!"
End If

Type your query in the textbox and click on the button.
jek1471
Re: Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
« #3 on: November 06, 2009, 12:59 PM »

what method are you using to call your database?
Are u using the data control or calling the data from code?

You need to code the cmd_click() procedure and provide and SQL such that when you click it, the SQL is invoked and seraches for the record in the database and display in the label.

Example below:

cmd_click()
SQL="SELECT * from theDatabase WHERE [label]='"+ucase(trim(txtText.text))+"'"
set rs=db.openrecordset(SQL)

if rs.recordcount>0 then
lblLabel.caption= rs!label

end sub

This may look complicated, let's discuss further - I'll explain

dotzok
Re: Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl
« #4 on: November 22, 2009, 01:40 AM »

"what method are you using to call your database?" - jek1471. Excellent. that was the 1st question that came to ma mind.

u can as well say

rs.Find("SerialNo=' " & UCase(txtSearch.Text) & "'")

theLabel.Caption = rs.Field("Fullname") or
txtfullname.Text = rs.Field("Fullname")

rs.Refresh
.
.
.


 Help Needed In Creating Session Variables   All About Programming In General  How Can One Get Codewarriors For Serious Collaborative Programming Projects  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.