Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Subform isn't loading properly

Posted on 2014-04-22
3
Medium Priority
?
478 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Assisted Solution

by:duttcom
duttcom earned 1000 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 34

Accepted Solution

by:
Norie earned 1000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

722 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