Solved

Display data in SubForm located in a Form Tab.

Posted on 2014-12-22
7
98 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
ID: 40514979
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
ID: 40515004
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
ID: 40515083
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
ID: 40521952
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
ID: 40522274
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
ID: 40522323
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
ID: 40523883
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

912 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

20 Experts available now in Live!

Get 1:1 Help Now