Private Sub Command1_Click()
Unload Me 'Unload the program End End Sub Private Sub Form_Load() 'set the Colwidth of the grid fg.ColWidth(0) = 550 fg.ColWidth(1) = 3000 fg.ColWidth(2) = 3000 End Sub Private Sub Text1_Change() Adodc1.RecordSource = "select PubID,Name,[Company Name] from publishers where ucase(mid(pubid,1," & Len(Text1.Text) & "))= '" & Text1.Text & "' and ucase(mid(name,1," & Len(Text2.Text) & "))= '" & Text2.Text & "'" Adodc1.Refresh fg.SelectionMode = flexSelectionByRow 'The mid function checkes the records according 'to the info typed in the textbox. 'It queries the ADODC with every letter typed 'in the textbox,making it a bit more refined 'search on the records. End Sub Private Sub Text2_Change() Adodc1.RecordSource = "select PubID,Name,[Company Name] from publishers where ucase(mid(name,1," & Len(Text2.Text) & "))= '" & Text2.Text & "'" Adodc1.Refresh fg.SelectionMode = flexSelectionByRow End Sub Inputs:Im using a MSHFlexGrid with a ADO DataControl. Connect the ADODC to the Biblio.mdb Set Recordsource to Publisers . Assumes:im using the Mid function. Get ADODC and connect To Biblio.mdb. |