Solved

Subform isn't loading properly

Posted on 2014-04-22
3
455 Views
Last Modified: 2014-04-23
I have a strange thing going on with one of my subforms in access.

My subform is based on a query that uses two date fields and an another field to filter the results.

When I first enter that information and hit refresh, nothing shows up in the subform. However, in the record counter at the bottom of the subform, it shows that there should be records there.

If I switch to Design mode and then go back to View mode then the items show in the subform.

I have no idea why this is.


I am attaching the database to this question. The form is titled frm_Act1TO.

The subform I am looking at is beneith the Beginning date and End Date fields
The button that I have set to pull up the records once the dates are entered is the Refresh button.

The third item that the query needs is the listing in the "Select a Sub Task Order" combo box.

Thank you, in advance!
From-Experts-Exchange.accdb
0
Comment
Question by:Megin
3 Comments
 
LVL 12

Assisted Solution

by:duttcom
duttcom earned 250 total points
ID: 40016396
The button macro isn't specifying which form to refresh. Edit the button macro and add a "GoToControl" before your refresh and then specify the name of your subform. Then when the button is clicked, the focus goes to the subform and the refresh loads the records.

Add a "GoToControl"
0
 
LVL 33

Accepted Solution

by:
Norie earned 250 total points
ID: 40016399
Try using this code for the 'Refresh' button's Click event,
    Me!SubPreviousReports.Form.Refresh

Open in new window


To do that select the button in design view, on the Event tab remove [Embedded Macro] from On Click, select [Event Procedure] and click the ellipsis  (...).

You should now see this,
Private Sub btnFindOldReports_Click()
   
End Sub

Open in new window

which is where the code goes, like this.
Private Sub btnFindOldReports_Click()
    Me!SubPreviousReports.Form.Refresh
End Sub

Open in new window

0
 

Author Closing Comment

by:Megin
ID: 40018254
Thank you for both answers!
I ended up useing the VBA because I am trying to get more practice with that.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now