VBKid04
04-14-2004, 10:20 AM
I have a recordset called customerRS that I want to be displayed in a flexgrid.
The difficult(?)/confusing part is...
I want to use a SQL query which will SELECT * WHERE CustomerID=1
(so this gets all fields where CustomerID=1)
but I only want to display the first 2 fields for each record on the flexgrid (which are called CustomerID and CustomerName).
This will allow the user to scroll through the Flexgrid seeing only the CustomerID and CustomerName, rather than lots of data they don't need to know about.
When the user selects 1 row on the Flexgrid though, and clicks a command button (cmdDisplay to display the entire record), I want the ENTIRE record (everything that was selected in the original SQL query) to be displayed in appropriate textboxes.
Firstly, Im not sure how to display only 2 fields of the entire recordset on the Flexgrid.
I can populate my grid with all fields using the code supplied here:
http://www.xtremevbtalk.com/showthread.php?t=35110
(under Show Table data in MSFlexgrid - perhaps someone can explain to me what I must change in this to display only the first 2 fields)
Secondly, after I have displayed only 2 fields on the flexgrid, would it be better to say something like (this pseudocode):
Where Flexgrid Selected value in Column1 (which is one particular CustomerID) = customerRS(CustomerID)
customerRS.Send all matching fields to textboxes
?
Does this make sense?
Only problem is, how do I go about this ?
Thanks for any help.
The difficult(?)/confusing part is...
I want to use a SQL query which will SELECT * WHERE CustomerID=1
(so this gets all fields where CustomerID=1)
but I only want to display the first 2 fields for each record on the flexgrid (which are called CustomerID and CustomerName).
This will allow the user to scroll through the Flexgrid seeing only the CustomerID and CustomerName, rather than lots of data they don't need to know about.
When the user selects 1 row on the Flexgrid though, and clicks a command button (cmdDisplay to display the entire record), I want the ENTIRE record (everything that was selected in the original SQL query) to be displayed in appropriate textboxes.
Firstly, Im not sure how to display only 2 fields of the entire recordset on the Flexgrid.
I can populate my grid with all fields using the code supplied here:
http://www.xtremevbtalk.com/showthread.php?t=35110
(under Show Table data in MSFlexgrid - perhaps someone can explain to me what I must change in this to display only the first 2 fields)
Secondly, after I have displayed only 2 fields on the flexgrid, would it be better to say something like (this pseudocode):
Where Flexgrid Selected value in Column1 (which is one particular CustomerID) = customerRS(CustomerID)
customerRS.Send all matching fields to textboxes
?
Does this make sense?
Only problem is, how do I go about this ?
Thanks for any help.