Solved

Subform isn't loading properly

Posted on 2014-04-22
3
450 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for both answers!
I ended up useing the VBA because I am trying to get more practice with that.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

12 Experts available now in Live!

Get 1:1 Help Now