Display data in SubForm located in a Form Tab.

Posted on 2014-12-22
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?

Question by:Bob_Collison
  • 4
  • 2
LVL 30

Expert Comment

ID: 40514979
Is the purpose of Tab2 sub-form B to just display the Results Table?
Upload a demo datbase to the issue.

Author Comment

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.

Author Comment

ID: 40515083
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.

Bob Collison.
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

LVL 31

Accepted Solution

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"
      Case "pgeCriteria"
         'Your code here
      Case "pgeExport"
         'Your code here
      Case "pgeHelp"
         'Your code here
   End Select
   Exit Sub

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

End Sub

Open in new window


Author Comment

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?

Bob Collison.

Author Comment

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.
LVL 31

Expert Comment

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.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
link access with Quickbooks 9 64
VS2015 compilation and missing DLLs 9 181
Is AWS.RDS considered a part of "Big Data"? 4 128
Please explain purpose of GZIP 4 56
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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.…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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