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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBGrid

Status
Not open for further replies.

lomano

Programmer
Joined
Nov 15, 2000
Messages
18
Location
CA
I am doing an assignment in school that requires me to use DAO with and Acces Database. What i want to do is to display my search results into the DBGrid.

I have set up a temporary recordset and have used SQL to retrieve the data i am looking for.

SQL = "SELECT * FROM PersonalContacts WHERE" _
& " Name Like '" & result & "*'"
Set fSearchresultRS = fcontactsDB.OpenRecordset(SQL)

How would i go about taking the results of this and putting it on a DBGrid.

Thanks
 
Take a data control (data1) and bind it to the DBGrid (Poperties DataSource )

SQL = "SELECT * FROM PersonalContacts WHERE" _
& " Name Like '" & result & "*'"
Set fSearchresultRS = fcontactsDB.OpenRecordset(SQL)
Set Data1.Recordset = fSearchresultRS

Succes Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX.

Download Demo version on my Site:
Promotions before 02/28/2001 (free source codebook),visite my site
 
Thanks. that worked perfectly...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top