Hello All,
I could really use some serious help with this one...
I have a form that has a tab control with 3 pages. Page(0) is Tasks,
Page(1) is SubTasks, and Page(2) is Elements. Page (1) is a subform of
page (0); linked with TaskID and page (2) is a subform of page (1);
linked with SubtaskID. I want to be able to have multiple subtasks for
some tasks; and multiple elements for some subtasks. The relationship
has been set accordingly; however when I try to add a second
corresponding record I am not able to retain the linked ID. For
instance, i have a task and want to make 2 subtasks. I can get the
first subtasks linked to the task but when I navigate to a new subtask
record, the taskId becomes 0 (not the previous/correct value). I tried
using the following code but it doesn't work.
Private Sub cmdAddNewSubtas k_Click()
On Error GoTo Err_cmdAddNewSu btask_Click
DoCmd.GoToRecor d , , acNewRec
Forms!Tasks!Sub Tasks1!TaskID = Me.TaskID
Exit_cmdAddNewS ubtask_Click:
Exit Sub
Err_cmdAddNewSu btask_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewS ubtask_Click
End Sub
I could really use some serious help with this one...
I have a form that has a tab control with 3 pages. Page(0) is Tasks,
Page(1) is SubTasks, and Page(2) is Elements. Page (1) is a subform of
page (0); linked with TaskID and page (2) is a subform of page (1);
linked with SubtaskID. I want to be able to have multiple subtasks for
some tasks; and multiple elements for some subtasks. The relationship
has been set accordingly; however when I try to add a second
corresponding record I am not able to retain the linked ID. For
instance, i have a task and want to make 2 subtasks. I can get the
first subtasks linked to the task but when I navigate to a new subtask
record, the taskId becomes 0 (not the previous/correct value). I tried
using the following code but it doesn't work.
Private Sub cmdAddNewSubtas k_Click()
On Error GoTo Err_cmdAddNewSu btask_Click
DoCmd.GoToRecor d , , acNewRec
Forms!Tasks!Sub Tasks1!TaskID = Me.TaskID
Exit_cmdAddNewS ubtask_Click:
Exit Sub
Err_cmdAddNewSu btask_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewS ubtask_Click
End Sub
Comment