UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Form Populates Text Boxes On Unknown Form Name, Access 2016    
 
   
chrish20202
post Jun 15 2019, 03:32 PM
Post#1



Posts: 23
Joined: 10-January 12



My db is to track census records of related people for a genealogical project. It has all the data from the census line.
frmSwitchboard is the main form
frmCensus1940 is a subform of frmSwitchboard. The subform control name is sfrmCensus1940.
There are separate forms for each census, all named with the same style, frmCensus1910, etc

I have a popup form that populates that persons record number from the genealogical program, (an export of that program in in the access be as a table)

I click a cmdButton on frmCensus1940 (or frmCensus1920, frmCensus1890, etc) that writes the last name, first name, etc to global variables. It then opens frmPersonsTMG which searches a table for that name.
Once it has a match (or I pick a match), it populates a different textbox on the referring form.

My problem is that frmPersonsTMG doesn't know which form was the referring form. I've tried using a global form variable and have googled for days without a working answer.

Any ideas would be gratefully appreciated.

Thanks,
Chris


Go to the top of the page
 
GroverParkGeorge
post Jun 15 2019, 03:46 PM
Post#2


UA Admin
Posts: 35,314
Joined: 20-June 02
From: Newcastle, WA


Unfortunately, the description of the problem seems to point to an underlying design problem. In a properly designed Relational Database, we'd not expect to see forms with names like "frmCensusXXXX", where there are, apparently, many different subforms all with the same basic data in them.

So before we go off trying to figure out the reference thing, let's dig down to the tables and make sure they are set up appropriately. Do you have TABLES with names like "CensusXXXX" as well?

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
chrish20202
post Jun 15 2019, 03:55 PM
Post#3



Posts: 23
Joined: 10-January 12



Each decades census shares some data but there are more fields that are unique to that year. I've tried using one form but it would need more than 250 fields to capture each census' data. I could use one form and write to a separate table per year but that opens up other problems.

tblCensus holds all the census data and tblCensusPeople hold that set of data, as each census page is a one-to-many type relationship. The separate forms are for ease of data entry.

You bring up a good point about design. I may have to rethink.

Thanks!
Chris
This post has been edited by chrish20202: Jun 15 2019, 03:59 PM
Go to the top of the page
 
GroverParkGeorge
post Jun 15 2019, 04:35 PM
Post#4


UA Admin
Posts: 35,314
Joined: 20-June 02
From: Newcastle, WA


"Each decades census shares some data but there are more fields that are unique to that year."
That, unfortunately, is often a characteristic of this sort of data, i.e data gathered from surveys, questionnaires and censuses. The CORE data points are constant, but people feel a need to tweek them every time out, so you end up with major variations.

The solution I recommend is to create that core census table with supporting child tables as needed to contain the individual additional data points for each census which are unique to that census. These would be related to the parent census records, one to one. No need for mondo-wide tables that fall down and break. I think that's very close to what you are describing as well.

"tblCensus holds all the census data and tblCensusPeople hold that set of data, as each census page is a one-to-many type relationship. The separate forms are for ease of data entry."

I see this working as you describe, except I don't think you open the census specific subforms outside the main form which is bound to your base, or master, tblCensus. It sounds to me like you are trying to move from the specific censuses to the master, but I'd do it the other way, focusing on the master, common set of attributes in the main form, but using subforms linked to that main form for specific details.

You might have to load different subforms into a single subform control because I think you would otherwise have too many subform controls to be practical.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th July 2019 - 07:19 AM