Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an input box to search for info from an MSFlexGrid 1

Status
Not open for further replies.

homesick

Programmer
Dec 5, 2001
55
CA
Hey...just wonder if anyone new how to use an input box to search for and display information in a Grid?


Here is what i'm trying...it worked in the change event, but i thought it might be easier for the user to use a button...so i wanted to use the click event for an input box...here is what i have...


Private Sub Command26_Click()
Dim db As Database
Dim rs As Recordset

Dim strFile As String
Dim strSQL As String

strFile = "a:\tracker"


InputBox "Enter Agent Name"

strSQL = "SELECT * FROM tracker where aname = '" & combo5.Text & "' and date = '" & Text2.Text & "'"



Set db = OpenDatabase(strFile)
Set rs = db.OpenRecordset(strSQL)

Call DisplayRSGrid(rs, MSFlexGrid1)

rs.Close
db.Close

Set rs = Nothing
Set db = Nothing

End Sub
 
hi ..
InputBox "Enter Agent Name" , whatever information input by the user is not going to store any where so u should use this statement like this
a=InputBox( "Enter Agent Name")

and use a variable instead if combo5.text ,in the Query .. to fetch required Data.

rest all looks fine

-Mala

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top