473,657 Members | 2,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Coordinating Data on Subforms of Main Form

sickenhoofer
19 New Member
I have a form w several subforms. The ultimate goal would be to click on a location, and have the data in the other subforms change to the data specific to that location.

For this form, there are 4 main tables (below). Here is the pertinent detail for the tables involved.

tblProviderMain (table 1)
ProviderMainID (PK, Autonum)

tblProviderNumb ers (table 2)
ProviderNumberI D (PK, Autonum)
ProviderMainID (global join to tblProviderMain )
NumberType (types = Medicare, Medicaid, BCBS, et al.)
LocationCode (global join to tblLocations)
Number

tblLocations (table 2)
LocationCode (PK, Autonum)

tblProviderbyLo cation (table 3)
ProvbyLocationI D (PK, Autonum)
ProviderMainID (global join to tblProviderMain )
LocationID (global join to tblLocations)

The parent form is based on qry of tblProviderMain . I have a subform for each NumberType within tblProviderNumb ers (Medicare, Medicaid, BCBS, et al). I want to be able to select one of the locations for a provider, and make the data specific to that location appear in the appropriate box (subforms).

For example: I select Charles Brown on the parent form. He has 3 locations listed (Peanutville, Snoopy Town, and Schultzway) If I click on "peanutvill e," the Medicare number and related data for that record should appear in the Medicare subform. The number type subforms (ex: medicare) are fed by similar queries, the only difference being the number type.

I attempted to reach the desired goal in 2 different ways. A brief explanation of each follows:

1. Created a simple query to feed the location subform (to create a list of locations for each provider)
Expand|Select|Wrap|Line Numbers
  1. SQL = "SELECT tblProviderbyLocation.LocationID, " & _
  2.              "tblLocations.LocationName, " & _
  3.              "tblProviderbyLocation.ProviderMainID " & _
  4.       "FROM tblLocations INNER JOIN tblProviderbyLocation " & _
  5.         "ON tblLocations.LocationCode = tblProviderbyLocation.LocationID;"
I tried to create an event procedure which would then populate the appropriate info in the number type subforms. However, this is where I got stuck.

2 The other attempt was to make a list box for the locations which was fed by a query of the tblLocations of only the location names. However, this listed ALL locations (not just ones specific to the provider in the active page).

If I could have gotten this method to work, I would have tried to add a FindRecord event procedure to the LocationCode control on the numbertype subform. I am unsure as to whether or not that would have worked, since I cannot get the first part to work.

I hope you can help. I appreciate any feedback.
May 12 '09 #1
5 2274
NeoPa
32,568 Recognized Expert Moderator MVP
From what I understood of your situation (many details provided - good. Not clear exactly what's going on - less good) you would design all the subforms to handle the full list of possible records (The Medicare subform would handle all records from [tblProviderNumb ers] where NumberType="Med icare" for instance).

From this point, the setup of the main form (specifically the subform control that contains the actual form used) would be set up such that Link Master Fields="ProviderMainI D" & Link Child Fields="ProviderMainI D".

Welcome to Bytes!
May 13 '09 #2
sickenhoofer
19 New Member
I have all the subforms set as you described (linked by providerMainID) . The trouble spot for me is that I need to create an additional subform or listbox that lists the locations for each provider. We have approx. 20 locations, but each provider works at only 1-4 locations. When the user clicks on a location, the subform data for Medicare, Medicaid, et al. should change to display the related number data for that location.

For example Charlie Brown works at location A B & C. I want to click on location A and see appropriate data in subforms Medicare, Medicaid, et al for location A. Clicking location B would have same effect. Does that make sense?

Here's what's happening:
I first created a subform (linked as above). So the location subform listed only locations at which the specific provider on the master form works. However, I wasn't sure how to use that to populate the related data in the other subforms: meaning, if I click one, I did not know how to use that location to change the display in the other subforms. I did not know if I could use an event procedure to change the other subforms, or if I need to do some other programming (I am at newbie level - I know jsut enought to be dangerous). Here is the SQL for the query feeding the location subform.
Expand|Select|Wrap|Line Numbers
  1. SELECT tblProviderbyLocation.LocationID, tblLocations.LocationName, tblProviderbyLocation.ProviderMainID
  2. FROM tblLocations INNER JOIN tblProviderbyLocation ON tblLocations.LocationCode = tblProviderbyLocation.LocationID;
Second attempt:
I then tried to make a listbox of locations. However, I was not sure how to link to masterform, so that it lists all locations for all providers, rather than just those where the provider on masterform works. This is the query for the listbox.
Expand|Select|Wrap|Line Numbers
  1. SELECT tblProviderbyLocation.LocationID, tblProviderbyLocation.ProviderMainID, tblLocations.LocationName, tblProviderbyLocation.ProvLocationEffectDate, tblProviderbyLocation.ProvLcoationTermDate, tblProviderbyLocation.Status, tblProviderbyLocation.GroupLocationNPI
  2. FROM tblLocations INNER JOIN tblProviderbyLocation ON tblLocations.LocationCode = tblProviderbyLocation.LocationID;
I thought along with this method, that I could use a FindRecord event procedure in the locationcode control in the related subforms (Medicare, Medicaid, et al), to aid in the change in display. However, I never got that far due to the way the results of the listbox query.
May 13 '09 #3
NeoPa
32,568 Recognized Expert Moderator MVP
It sounds like you have a two-dimensional cut required.

One dimension (ProviderMainID ) is controlled by the link to the main form.

The second cannot be managed that way.

I would consider setting the filter properties of the various subforms when a location is selected from a ComboBox control on your main form.

In the AfterUpdate event procedure of the control cycle through the forms in all your subform controls and set these properties to filter for only those items that match the selected location.

Does that make sense?
May 13 '09 #4
sickenhoofer
19 New Member
I understand what you are saying. I will give it whirl. Thank you, very much for your help . . .invaluable resource!
May 13 '09 #5
NeoPa
32,568 Recognized Expert Moderator MVP
It's a pleasure to help.

If you can run with a solution that's even better.
May 13 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

32
3216
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being lost when they move to a new record. This seems to be the case when there are multiple users. When there is a single user using it, we don't seem to have that problem. It seems that we had this problem when we first converted from an MDB back end...
1
2982
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
2
2995
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
2239
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
7
2286
by: Neil Ginsberg | last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7 back end, using ODBC linked tables. I previously wrote about this, but am reposting it with some additional information and in summary form, in hopes that someone might have an idea about what's going on. I am using a bound form which is losing data a significant portion of the time. Basically, the form contains 6 fields and three subforms, as follows: Field A...
7
2323
by: lauren quantrell | last post by:
A while back I got a requirement for the client to be able to adjust the relative heights of two subforms by click-dragging the mouse and I came up with a kludge solution using a border control between the two subforms. But I put my mind to this again recently and came up with a solution (code below) that works well with multiple subforms to size both the heights and widths of the sunforms relative to each other, and it uses no additional...
1
1894
by: kenduron | last post by:
Hello together! How would you manage the following termin: I got table "A" and table "B" I have to show most of the fields in "A", an one columm in table "B". But table "B" can have several entries which belongs to A.
2
2015
by: collegekid | last post by:
Hi everyone, basically my problem is this: I am using an Access 2000 format. And--I have four subforms in my main form. (Purpose of this is to track projects.) So in my main form I enter the project name, one primary point person for it (1:N list from a separate table), other details, and a manually entered tracking number, which is the primary key. Now, I also need to put down the legal entities, business managers, financial...
3
1934
by: OzNet | last post by:
Hi I have a main form and want to put two subforms on a tabbed control (on the same tab) Subform 1 will display data if it corresponds with the data on the main form. When this is true, subform 2 will be blank Likewise, subform 2 will display data if it corresponds with the data on the main form and when this is true, subform1 will be blank. How can I make the subforms visible only when there is data present?
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.