Solved

Subform isn't loading properly

Posted on 2014-04-22
3
456 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 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