954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Text box population from DBgrid. HELP!!

hi there,
i ve got a visual basic project that is being linked to an access database.
i ve already got a search function working to populate text box's with the information from one table in the relational access database. i am using the ADODC control to connect to the database. what i have got now is a DBgrid control on there to display the information from another table in the database.

What i want to do is for the DBgrid to populate another set of text box's with the information that is related to the information that i searched for, using the ID number as the foreign key in the table that populates the Dbgrid.

sorry if this doesnt make sense but i have tried to explain it as best i can.
please any help would be good or any suggestions for that matter.

Thanx alot people :)

lostprophet
Newbie Poster
5 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Hi,
i don't know if this what you need. Assuming you have text1 you can do like this:

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
text1=adodc1.recordset("name")

End Sub

What this do is it will populate the text1 everytime you change your row.
hope it will help.

NewVBguy...

NewVBguy
Junior Poster in Training
71 posts since Mar 2005
Reputation Points: 13
Solved Threads: 3
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You