Solved

Display data in SubForm located in a Form Tab.

Posted on 2014-12-22
7
97 Views
Last Modified: 2014-12-30
Hi Experts,
I have a Form (Form A) containing 4 Tabs.  Tab 1 is used to run Event 1 that extracts data from a series of Tables and loads the results into a Results Table.  Tabs 3 and 4 are irrelevant.

 Tab 2 contains SubForm B that is a Continuous Form- not bound to the original Form A - that is bound to the Results Table the purpose of which is to display the Results Table data.

When I click on Tab 2 after Event 1 has completed, SubForm B displays but no data is displayed.

It will display if I click a second time on Tab 2 and then Scroll my Mouse. on SubForm B.

How do I get the data to display in SubForm B when Tab 2 is clicked?

Thanks.
Bob.
0
Comment
Question by:Bob_Collison
  • 4
  • 2
7 Comments
 
LVL 30

Expert Comment

by:hnasr
Comment Utility
Is the purpose of Tab2 sub-form B to just display the Results Table?
Upload a demo datbase to the issue.
0
 

Author Comment

by:Bob_Collison
Comment Utility
The purpose is to display the results.  In addition, there is a flag field that can be changed to indicate whether or not to use each record in further processing.

I will have to extract this specific code from a very large application (55 Meg just for the code without backend DBs) to a Support DB that I can  upload.  It will take me a day or so and will complete it ASAP.

Thanks for your interest in this question.
Bob Collison.
0
 

Author Comment

by:Bob_Collison
Comment Utility
Hi,
The creation of the application specific elements was easier than I thought.

When the Access 2003 MDB is double clicked it automatically loads Form A.

To see the issue:
- Click the 'Criteria' Tab.
- Click the 'Select All Selection Criteria' button.
- Click the 'Initialize Data' button and watch the Message box at the bottom of the form.  It is very fast.

Click the Select Tab.  The result should be that the records created in the [00_EMAIL_EXPORT_DATA] Table in the previous steps are displayed in SubForm B on this tab.  This table is automatically emptied when the form is closed.

The User can then scroll through them and change the Y/N field at the right side to identify the addresses to be exported through the steps on the Export Tab.

Note that the Help and Export Tab functions have no impact on this issue with the records not displaying.

Thanks.
Bob Collison.
Org-Email-Export.mdb
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
Comment Utility
Just do a requery to get the data to display on the Select tab.  F9 in the interface, or Requery for an object in code.   This event procedure for the Tab control will do it (I renamed some objects with the appropriate LNC prefixes):

Private Sub tabChoices_Change()

On Error GoTo ErrorHandler

   Dim tbc As Access.TabControl
   Dim pge As Access.Page
   Dim strPage As String
   
   Set tbc = Me![tabChoices]
   Set pge = tbc.Pages(tbc.Value)
   strPage = pge.Name
   
   Select Case strPage
      Case "pgeSelect"
         Me![subExportSelection].Requery
         
      Case "pgeCriteria"
         'Your code here
      
      Case "pgeExport"
         'Your code here
      
      Case "pgeHelp"
         'Your code here
      
   End Select
   
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in " & Me.ActiveControl.Name & " procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub

Open in new window

0
 

Author Comment

by:Bob_Collison
Comment Utility
Hi Helen,
Thanks for the solution.  Unfortunately I'm not sure what to do with it as I am not familiar with this code at all.

First within the Form Object (I assume it is Form A) where do I create this Event (tabChioices_Change)?

Secondly I assume that I need to change the Tab Control Properties > Other > Name Page Names to those in the Case Statement.  Is this correct?

Once I create the Event I don't know what to do with the various Case Statements that you have provided.  Right now most of the code is within Events at the Form A Level.  Is this correct or should some of them (like the Selection Button Code) be within the individual Tabs?

Thanks.
Bob Collison.
0
 

Author Comment

by:Bob_Collison
Comment Utility
Hi Helen,

I was able to figure it out and it is working so you don't need to respond to my questions.
Thanks very much.
Bob Collison.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
Comment Utility
Good -- I put in the other cases so you could put code there if needed (the code runs when a tab is clicked).  This is good for refreshing data when a change is made on another tab.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

11 Experts available now in Live!

Get 1:1 Help Now