The answer is probably simple. I have bound the grid to a recordset, but I don't want to display all the field in the recordset. I found I can do this at design time through the properties. Under the band tab. How can I change this during run time?
Printable View
The answer is probably simple. I have bound the grid to a recordset, but I don't want to display all the field in the recordset. I found I can do this at design time through the properties. Under the band tab. How can I change this during run time?
You want to do a SQL on your datacontrol. At design time make a text box and a button on the form. Then place this code in the button Click event. This is for a person imfo. by name.
Dim Sql As String
Dim name As String
Dim db As Database
Dim dbs As Recordset
name = Text1
Sql = "Select* from Tablename where field = '" & name & "'"
Set db = OpenDatabase("Database Path")
Set dbs = db.OpenRecordset(Sql)
Set Data1.Recordset = dbs
Data1.Refresh
I think I used the wrong term. When I said field, I meant the columns that display in the MSHFlexGrid. I have already used a SQL command to create a recordset but I don't want each field in a record to be displayed in a column.