INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

(OP)
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

RE: Display query results in a form - same form, many queries

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

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Display query results in a form - same form, many queries

just put the query in a subform and all the controls on the main form. Set the source object of the subform and manipulate the query. See this for datasheet manipulation
https://msdn.microsoft.com/en-us/library/office/aa...

RE: Display query results in a form - same form, many queries

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 --> vba

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

Duane
Hook'D on Access
MS Access MVP

RE: Display query results in a form - same form, many queries

(OP)
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

RE: Display query results in a form - same form, many queries

(OP)
Sorry, i get it...

Me.sfQuery.Form.AllowDeletions = False

Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close