|
-
Oct 25th, 2010, 06:29 PM
#1
Thread Starter
Junior Member
load recordset into textboxes
hi guys,
I am working on a proyect and i got stucked,
The thing is i have a form which contains a datagrid, and a group of txtboxes
I load information into the datagrid through a recorset called rsservices that uses a db table in informix ( i work with adodb connection and adodb recordsets)
and it works fine.
Then when you click in a record into the datagrid i want it to display the information of the row selected into the textboxes , there are like 5 textboxes each one shows a different info of the same row.
ex : row = Name, last name, address, gender, id etc
but i failed doing that
what I tried was, in the activated event of the form :
Code:
If rsservices.State = 1 Then
rsservices.Close()
End If
rsservices = Nothing
sql = "select * from services"
rsservices = cn.Execute(sql)
datagrid.DataSource = rsservices
'then here i match the database fields with the form textboxes
ex: txtname.text = rsservices("name").value
end sub
after i do all that and run the program the thing loads the first row into the textboxes but when i try to select another row from the datagrid it does nothing
somebody can help me please ??
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|