I was trying to find an answer for my issue over the net, but it was hard to find any relevant information. I'm in the middle of my school project and I got stuck in a dead point!

I have a form which looks like this:

http://i60.tinypic.com/24zjfpl.jpg

I don't know how or even if it is possible to retrieve customer details from my database using customer ID. Logic of this process is simple. I need to put a unique customer ID, press retrieve button, then it will go to my database in access, search for customer with given ID ,retrieve customer details and fill different text boxes on my form. Seems easy but I have no clue how or where to start :(

I have a few forms like this in my project, so I would be grateful for any hints or solutions guys! Thanks in advance!

I don't know how or even if it is possible to retrieve customer details from my database using customer ID.

its possible if you have customer ID field in your database table.you have to use select command to retrieve data from the table.

press retrieve button, then it will go to my database in access, search for customer with given ID ,retrieve customer details and fill different text boxes on my form.

you have to write the code on the click event of the buttion.and there would be various ways for retrieving data from database. since i don't play with visual basic 4/5/6 therefore i can't tell the exact way to do this.

But i'm reading the book databases and i can provide the sql query for retrieving data from the table. this would be as follow :

"select * from table where id="+text1.text

and the result will be stored in the recordset further you can do the following to print the reuslt

text2.text=rs!field2
text3.text=rs!field3

and so on....

atlast , it's not possible to explain everything and if somebody write the exact code for you then it will go in vain becuase it seems you are also a beginner and you this will not provide the way to learn new things.

i'd highly recommend you to go through a good database tutorial so that you can understand what is connection string , what is connection , what is recordset etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.