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!

Passing parameter to DataGrid object

Status
Not open for further replies.

victor10

Programmer
Apr 24, 2002
1
US
Hi everybody, I work with VB 6.0 and Access 97.

On my form I have textbox txtCompany, DataGrid1 and ADO.
ADO is connected to database and for RecordSource I have
SELECT * FROM Customer. So it displays all rows.
I want to display only customers for the company that typed in textbox.

Should I have sql in RecordSource as 'SELECT * FROM Customer where Company = ?' and call Datagrid at runtime.

Please help, never done it before.
Thank you.

 
try making your sql say
"select * from " _
& "customer where company_name ='" _
txtCompany.text & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top