Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 110
  • Last Modified:

Display data in SubForm located in a Form Tab.

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
Bob_Collison
Asked:
Bob_Collison
  • 4
  • 2
1 Solution
 
hnasrCommented:
Is the purpose of Tab2 sub-form B to just display the Results Table?
Upload a demo datbase to the issue.
0
 
Bob_CollisonAuthor Commented:
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
 
Bob_CollisonAuthor Commented:
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
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
Helen FeddemaCommented:
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
 
Bob_CollisonAuthor Commented:
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
 
Bob_CollisonAuthor Commented:
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
 
Helen FeddemaCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now