My problem is in a form/subform. On the main form I have an unbound listbox
named OptionsInPlan. In the OnCurrent event of the main form I set the value of
the listbox with the code:
Me!OptionsInPlan.Value = Me!OptionsInPlan.ItemData(0)
For some records there are no rows in the listbox.
I want to have the subform track the value of the listbox so I set the
LinkMaster property to OptionsInPlan and the LinkChild property to ElevationID.
When I make selections in the listbox or navigate with the navigation buttons
the subform tracks the value of the listbox and displays the correct
corresponding records.
My problem lies when I try to add a new record to the subform. I have unbound
textboxes directly above each field in the subform and in the last textbox I use
the AfterUpdate event to execute the Add New method to add the values in the 5
textboxes to the underlying table. When the AfterUpdate event fires, the new
record appears in the subform for a moment and then disappears. When I check the
table, the 5 field values have been added but the foreign key(ElevationID) has
not. I have tried it with and without this code in the Add New method:
Rst!ElevationID = Me.Parent!OptionsInPlan and get the same results.
Can someone help with a solution to this problem?
Thanks!
Traci