S
Sharon
I am using Microsoft Access 2003.
I have the following three tables:
1. tblToDo
ToDoID (pk)
ToDoCategoryID
ToDoActionID
DueBy
DocketNumber
ToDoInstructionsID
ProgressID
2. tblToDoInstructions
ToDoInstructionsID (pk)
DoDoInstructions
ToDoID
ProgressID
3. tblToDoProgress
ProgressID (pk)
CompletedDate
ProgressNotes
Done
ToDoID
ToDoInstructionsID
I am trying to create a form using the tblToDo information as the main form,
the tblToDoInstructions as a subform (preferably continuous as there are
different steps to accomplish the task) and a command button that opens
Progress notes for each instruction.
The main form (tblToDo) is linked to the subform through the ToDoID.
I created a command button on the subfrmToDoInstructions to open the subform
subfrmToDoProgressNotes. Private Sub cmdbtnProgressNotes_Click()
On Error GoTo Err_cmdbtnProgressNotes_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "subfrmToDoProgress"
stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdbtnProgressNotes_Click:
Exit Sub
Err_cmdbtnProgressNotes_Click:
MsgBox Err.Description
Resume Exit_cmdbtnProgressNotes_Click
End Sub
My problem is that when I select the command button, it opens the
subfrmToDoProgress but the fields for ToDoInstructionsID and ToDoID are "0".
How do I link these IDs so that the subforms will pull up the corresponding
records. Any help is appreciated.
I have the following three tables:
1. tblToDo
ToDoID (pk)
ToDoCategoryID
ToDoActionID
DueBy
DocketNumber
ToDoInstructionsID
ProgressID
2. tblToDoInstructions
ToDoInstructionsID (pk)
DoDoInstructions
ToDoID
ProgressID
3. tblToDoProgress
ProgressID (pk)
CompletedDate
ProgressNotes
Done
ToDoID
ToDoInstructionsID
I am trying to create a form using the tblToDo information as the main form,
the tblToDoInstructions as a subform (preferably continuous as there are
different steps to accomplish the task) and a command button that opens
Progress notes for each instruction.
The main form (tblToDo) is linked to the subform through the ToDoID.
I created a command button on the subfrmToDoInstructions to open the subform
subfrmToDoProgressNotes. Private Sub cmdbtnProgressNotes_Click()
On Error GoTo Err_cmdbtnProgressNotes_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "subfrmToDoProgress"
stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdbtnProgressNotes_Click:
Exit Sub
Err_cmdbtnProgressNotes_Click:
MsgBox Err.Description
Resume Exit_cmdbtnProgressNotes_Click
End Sub
My problem is that when I select the command button, it opens the
subfrmToDoProgress but the fields for ToDoInstructionsID and ToDoID are "0".
How do I link these IDs so that the subforms will pull up the corresponding
records. Any help is appreciated.