borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (ole object ) New Topic New Poll Post Reply
AndreaVB Forum : Database : Geting the Character on the list Menu
Poster Message
noknok
Level: Scholar

Registered: 23-11-2007
Posts: 37

icon Geting the Character on the list Menu

Now this one is new problem where to start,

This is the scenario, After searching the record it goes the listbox so from the list box u lick ok and that name appear in the listbox wil go to the form field with data

04-02-2008 at 01:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1040
icon Re: Geting the Character on the list Menu

Hi
What have you tried? Which bit do you have a problem with?


Using Google ("vb6 populate listbox from recordset"), I found:
http://www.vb-helper.com/howto_ado_populate_list.html

Does this help?

[Edited by stickleprojects on 04-02-2008 at 03:18 PM GMT]

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

04-02-2008 at 03:14 PM
View Profile Send Email to User Show All Posts | Quote Reply
noknok
Level: Scholar

Registered: 23-11-2007
Posts: 37
icon Re: Geting the Character on the list Menu

Will my problem is bak in my project biodata, in my medata.mdb database i have 4 tables the information of person like their adres, age,name etc which is the biodinfo and the other table are the payments example, then i have search box so when i find the name of that person on my search box it will return with answer in my listbox so then click the name of that person and click ok, the ok buton suposed load all the information of that person in my biofrm with the information like adres, age, name etc except the payments,

so the steps still the same right

open connection and the database then call it to the form

so this one is my code

set rs = new recordset   'i already have Public rs as recordset in my module

open db

rs.open (select * from table  _____ what next should i put this is my problem)

biofrm.lnametxt.text = rs("lname")   ' geting the last name of my biodata table
and blah blah blah

which is corect or corect me if im wrong so the main problem to is rs.open (select * from table  _____ what next should i put this is my problem) how will i pupulate this with all the infor in my biodata table to filled that needs in my biofrm

thanks for help

05-02-2008 at 01:13 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1040
icon Re: Geting the Character on the list Menu

I found this code that opens a recordset, and a database and populates a control on a form (albeit, this is a listbox), interestingly it also finds a record.

http://www.andreavb.com/forum/viewtopic.php?TopicID=8101&page=0#26604



____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

05-02-2008 at 08:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
noknok
Level: Scholar

Registered: 23-11-2007
Posts: 37
icon Re: Geting the Character on the list Menu

yea i know that already but the problem is how will i split that ^^ and to populate all that records with all the information only information it goes out is lname and fname , what about the rest like adres and age etc

05-02-2008 at 09:10 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1040
icon Re: Geting the Character on the list Menu

To read the value from a recordset, use the following syntax:

myvalue = rs.fields("fieldname").value


for example:

dim myname as string

myname = rs.fields("name").value


to display text in a textbox, draw the textbox on a form and use the following syntax:
me.textbox1.text = myvalue


By mixing these statements with the code already written for you, you should be able to display any given field from a recordset.


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

06-02-2008 at 07:48 AM
View Profile Send Email to User Show All Posts | Quote Reply
noknok
Level: Scholar

Registered: 23-11-2007
Posts: 37
icon Re: Geting the Character on the list Menu

Thanks for the Update, just back to my training to continue. a little bit busy to my work ^^ so it takes me long time to came back here. ill try ur sugestion thanks a lot ill post the result ASAP ^^ . ive already get the result but my prob is isntead the name i see in the listbox will appear on my form, other name are displayed wew im on it just a little bit more ^^

[Edited by noknok on 14-08-2008 at 09:41 AM GMT]

14-08-2008 at 09:38 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Geting the Character on the list Menu
Next Topic (ole object ) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder