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!

Querys

Status
Not open for further replies.

Tom123456

Programmer
Apr 2, 2003
70
SE
Hello all, How do I create a query at runtime and open a form with the result. Example the SQL statement "SELECT Name FROM Persons" open a form frmPersons and show all the names. (The textfield that contain the name can be static in the form).




- Tom
 
Hi

It might be a little easier to display the results in a listbox, depends on the data that you want to display I guess..

Code:
Dim stSQL as String

stSQL = "Select Name " _
    & "FROM Persons;"

Me.lstListBox.RowSource = stSQL
Me.lstListBox.Requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top