Solved

Subform isn't loading properly

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

790 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