E. Heineken
February 8th, 2000, 02:25 PM
Hi, I need help with some datagrid problems. I'm trying to have my application be able to allow the user to select 1 record on the datagrid and have all the data of that record displayed in a bunch of textboxes. I checked MSDN library and found that "SelBookmarks" sounds pretty similar to what I need. However, I do not quite understand how i can use it. I would appreciate any help. Thanx
Aaron Young
February 8th, 2000, 03:51 PM
When the User clicks on the Grid the Record Pointer in the Recordset would have been moved to the desired Record, so just use the values in the Recordset to populate the Textboxes in the RowColChange Event, ie.
Text1 = ADODC1.Recordset("Field1")
Text2 = ADODC1.Recordset("Field2")
Etc..
Aaron Young
Analyst Programmer
ajyoung@pressenter.com
aarony@redwingsoftware.com
E. Heineken
February 10th, 2000, 11:30 AM
Sorry I'm still a beginner in VB, so I need some more help. I tried the method Aaron mentioned. But it turned out that whichever record i click to, the textboxes still display the data from a certain record. (For instance, I have 10 records in the datagrid, and no matter which record I click on, the textboxes show the stuff in, let's say, record 5, notice that the display DOES change from any other records to record 5 in the 1st time, but it just stays in record 5 forever). Why is this and how can I solve it? And am I supposed to put the "open connection" statement into the RowColChange Event as well like this?
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
.
.
.
rs.Open
And also 1 more thing that maybe related to the problem, is that after I select a record in the datagrid, all of the buttons on my form don't respond (not even the close window button on the top right corner, I have to manually stop the compiling in order to stop the program.)
Thanx in advance for any help.