Tab Control Problem needs help

belsha

Registered User.
Local time
Today, 04:51
Joined
Jul 5, 2002
Messages
115
I have a tab control with a number of tabs based on the Infant table. My last two tabs on the tab control contain subforms with information contained on the Mother table. There is a one (Mom) to many relationship, with the Mother ID being a foreign key in the Infant table. May be a stupid question, but 1)how do I get the Mother ID (autonumber) into the infant table from the form, and 2) Why do I keep getting an error on the last name field in the mother form saying I can't assign a value to that object, when nothing is in that field yet?(I am entering the first record, first mother of the infant who has just been entered).
 
Belsha:
I think what you are saying is that when you enter a new record into the subform is will not take because the Key is Null. If so, in the subform set the Default value of the "Mother" Key to be [Forms]![NameofForm]![NameofPrimaryKeyfield] (obviouly, you'll need to change these to your form and field names).

HTH
 
Subform problem

Figured it out, I needed to have the mother tabs come first so on the infant page the mother's ID would automatically fill in and "connect" the infant to the mother, since the relationship is 1 mother to many infants. Works like a charm. Another question, when my form opens and a user clicks on the various tabs in my tab control, some (when clicked on) allow the user to see that page and all the tabs, and some tabs allow the user to see the form but they need to scroll up to see the tabs. Any ideas??
 
subform problem solved

On the issue of being able to view the tabs, I needed to resize the subforms on those tabs. If they were too large, when the tab was selected, the rest of the tabs would "disappear" until you scrolled up. Shorter subforms allowed the tabs to stay visible at all times.
 

Users who are viewing this thread

Back
Top Bottom