• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 712
  • Last Modified:

Query results not displaying correctly in subform

I have a query (MyQuery) that looks like this:

Select Field1, Field2, Field3, Field4 from My Table

When I run it directly, it correctly returns 4 columns of data.

I'm trying to display the query results in a subform on a main form.

When I do, only one column, namely Field4, of data is displaying

The source object of the subform is MyQuery

What am I doing wrong?
  • 2
1 Solution
What do you mean by subform here?
Dale FyeCommented:
Did you actually create a subform from the query, or did you create the subform control and assign the query as the SourceObject of the subform, or did you use the query as the rowsource for a listbox?

If you created a subform, then you need to make sure all of the fields are on the subform, and the form is wide enough to display all of those fields.

If you created the subform control and assigned the query as the SourceObject of the subform, then I'm not sure what the problem is other than that the field that is displaying is too wide to see the other fields.  Right click on the field and change the column  width property.

If you actually are displaying the query results in a listbox, then change the column count and column width properties of the listbox.
dbfromnewjerseyAuthor Commented:
I had originally created a subform that was displaying the entire contents of a table. I then attempted to change it to display the results of a query instead by changing the source object in the subform's properties window.  The query runs against the same table as was originally displayed in the textbox.

The table only has 4 fields.  But instead of displaying the entire table, I (eventually) want to display query results so they I can limit the number of records that get displayed.  

As a starting step, all I was trying to do at this point was to select all of the records from the table and have them display in the subform.  Just to see if I could get the query results to display. So actually, if it was working the way I want it to, the query results should be displaying exactly as if I was displaying the table directly since I'm selecting all records in the query.  I still have to read through everything you experts wrote, so I'll try to work it out and post again.
dbfromnewjerseyAuthor Commented:
OK. Got it working.  Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now