Hi,

I have one MSHFlexGrid that should show data from MS Access database. I have one textbox "txtSearchID". When I click on cmdDetails, it should get the number from txtSearchID and show the related records in MSHFlexGrid.

The following code works fine:

VB Code:
  1. rs.Open "Select Sid, Scustname, Sdate, Sitemno, Sqty from Supplied ", db
  2. Set MSHFlexGrid1.DataSource = rs

But the following code to get data from txtSearchID and show records is not working...simply it shows nothing.

The following is the code (Which is not showing any record except the column headers:

VB Code:
  1. rs.Open "Select Sid, Scustname, Sdate, Sitemno, Sqty from Supplied Where Sid='txtSearchID'", db
  2. Set MSHFlexGrid1.DataSource = rs

Regards,

Margaret