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!

Inserted subForm not sorting properly

Status
Not open for further replies.

era1995

Technical User
Mar 20, 2009
7
US
Hi There,
I created a form called frm_donation_data. The form has 5 fields in it from the table which has about 20 fields. I had this form sorted by descending dates. I then inserted this form as a subreport/form into my main form. Everything was fine.
Then I had new donations come for 2008-2009 and had to update the donations table; which I did using an append query. Again, all was good. However, the subform in my main form is not updating correctly. The new data is there, but it will not sort by descending dates. The table and the main form are sorted by descending dates, but the subform will not.
Am I missing something here?
Any help would be greatly appreciated.
Thank you in advance for your time!!!
=)
 
How do I get the SQL view on my forms? Sorry Im a nebbie to Access.

Appreciate your help...
 
View the design of the form and find the data properties. You should find the Record Source property which you can open in design view by clicking the [...] builder button. Then switch to the SQL view to find what I was asking for.

Duane
Hook'D on Access
MS Access MVP
 
I got an error message when I clicked on the record source.
"You invoked the query builder on a table
 
Apparently you don't have any sort order in the Row Source. It is probably just a table name like:
[tt][blue]
Row Source: tblDonations
[/blue]
[/tt]
You would need to change the Row Source to a sorted query so it might look like:
[tt][blue]
Row Source: SELECT * FROM tblDonations ORDER BY DonationDate;
[/blue]
[/tt]

Duane
Hook'D on Access
MS Access MVP
 
Hi Duane,
Thank you for your help! I've been out of the office sick all week, so I'm sorry for my late reply.
However, I tried to change the record source and run a new query, but it still doesn't work. This form just WILL not descend. I am attaching a copy of what the form properties looks like.

Thanks for your help on this! I have to have this completed by Monday... Ughhhh

 
 http://i104.photobucket.com/albums/m168/teeenamarie21/form_properties.jpg
It looks like your Record Source is just a table name. Click the builder button on the right and go into the query design so you can set the sorting. I would expect your resulting query SQL view might look like:
Code:
SELECT tbl_Donation_Data_June_23.*
FROM tbl_Donation_Data_June_23
ORDER BY [Your Field Here];
Exit the query builder so the Record Source is then the SQL statement. Remove the Order By clause and save the form.

Duane
Hook'D on Access
MS Access MVP
 
Thanks for trying, but now the form doesn't even come up on the main form. Also it is no longer linked by the primary keys....of the main form...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top