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

Display query results in a form - same form, many queries 2

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
582
0
16
GB
Hello,

Is there an easy way to display the results of queries in an unbound form?

I just want to display the result of the query data to the user, but would really like to control the display of the query in a form (so I can pop it up and control the dimensions etc.).

The queries each have different fields and come from different tables.

Or if anyone has other suggestions of an easy way to display queries.

Many thanks Mark
 
You can display the results of your queries in Mshflexgrid or Msflexgrid

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
This can be fairly easy.

Create a new form and add a combo box with these properties:
Name: cboQuery
Row Source: SELECT msysobjects.NAME FROM msysobjects WHERE Type=5 ORDER BY msysobjects.NAME;
You can modify the row source SQL to further filter the queries.

Add a subform control on the form with these properties:
Name: sfQuery

Add code to the After Update of the combo box

Code:
Private Sub cboQuery_AfterUpdate()
    Me.sfQuery.SourceObject = "Query." & Me.cboQuery
End Sub

Duane
Hook'D on Access
MS Access MVP
 
That is all working a treat - thank you.

Is there anyway to make the subform read only?

I have set 'locked' to true, which stops edits, but i can still delete records from the query.

Thanks Mark
 
Sorry, i get it...

Me.sfQuery.Form.AllowDeletions = False

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top