When to use Linked Forms vs. Subforms

sfoster1

Registered User.
Local time
Today, 14:46
Joined
Nov 28, 2001
Messages
19
Trying to determine if I am going about this right. I have two primary questions: 1) Should I be using Linked Forms or should I be using Forms with Subforms?; 2) What is the best way to stay with a particular record as I move from form to form.

Let's say I have four tables:

tblStudents
tblChecklist1
tblPlan
tblChecklist2

I want to be able to enter basic student data in a form to go into the tblStudents. From there I want to go to a checklist where I will enter dates that certain events are achieved. Once all items on Checklist 1 have been met, I want to be able to navigate to the tblPlan where I will key in three fields: the concern, the person responsible, and the action taken. From there I want to be able to go to Checklist2 (completely different types of data than Checklist1) to enter follow-up dates and other tasks to be achieved by a certian number of days. Down the road I need to be able to generate reports showing students with open dates (unfulfilled tasks).

I hope I have been specific enough. Does this sound like a setup best met with Forms and subforms, linked forms, or something else.

I have used DLookup and command button wizards thus far to move "up the ladder" from frmStudents to frmChecklist 1 and then from frmChecklist 1, then again from frmChecklist 1 to frmPlan, and then possibly to Checklist2 to add some different data about student progress. I have had mixed results with the correct data traveling with the correct student. Any suggestions on how to approach this situation?
 
1. Subforms are the easiest to implement since they don't require any coding. You just need to make sure that the master/child links are properly set.
2. When you open one form from another, use the where argument of the OpenForm method to "position" the opening form on the prior form's current record. In the popup form, you'll need to populate the foreign key so that the records are linked. To do this, I find the BeforeInsert event to be best. That way I don't dirty the record by placing a value in a control before the user has started entering data. This saves a lot of confusion in the long run. To populate the foreign key field -
Me.TheForeignKey = Forms!YourFirstForm!TheKeyValue
 
____________________________________________________To populate the foreign key field -
Me.TheForeignKey = Forms!YourFirstForm!TheKeyValue
____________________________________________________

What is the command string if you want to move data the other way from the open form to the first form?

Is it
Forms!YourFirstForm!TheFieldValue = Me.TheFieldValue

?
 

Users who are viewing this thread

Back
Top Bottom