Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing a datagrid record to Textboxes.

Status
Not open for further replies.

JMelvin

Programmer
Sep 24, 2002
4
US
I want to take a selected record from a Datagrid in VB6 and on command1_click load the highlighted record field by field into textboxes?

txtFName = datagrid1.??????

FName is the first column of the datagrid.

Am I even close???

 
Dear Friend:
I never worked with datagrid because i don't create a recordsource but usually o display some records or fields you have to:
1- Set the column and the row that you want to retrieve the data from ex:
datagrid1.row=1 (to read the cell of the second row)
datagrid1.column=2 (to read the third column)
2- Msgbox datagrid1.text
you have the value of the selected cell(2,3).

Hope it works.
John Vai
 

txtFName.Text = Adodc1.Recordset.Fields("FName").Value
 
HI JMELVIN,

IT is quite simple.

try using the code

"txtFname.text = datagrid1.seltext"

this brings the highlighted record field string from the datagrid to the text box

try out....

good luck

with regards,
manojEP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top