main form/subform/command button for another subform

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.
 
M

Maurice

Two options:

first try:

stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]
lose the double quotes at the end

second:

Your filter could reference the mainform. The way it is setup now it's
referencing the subform. try:

stLinkCriteria = "[ProgressID]" = " & Me.parent![ProgressID]
 
K

Klatuu

to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
 
S

Sharon

Maurice, thanks so much for your response.

I tried to lose the quotes at the end, but the they were automatically put
back in?


--
S


Maurice said:
Two options:

first try:

stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]
lose the double quotes at the end

second:

Your filter could reference the mainform. The way it is setup now it's
referencing the subform. try:

stLinkCriteria = "[ProgressID]" = " & Me.parent![ProgressID]
--
Maurice Ausum


Sharon said:
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.
 
K

Klatuu

should be:
stLinkCriteria = "[ProgressID] = " & Me![ProgressID]
Assuming [ProgressID] is a numeric field. If it is a text field, it would be:
stLinkCriteria = "[ProgressID] = '" & Me![ProgressID] & "'"
--
Dave Hargis, Microsoft Access MVP


Sharon said:
Maurice, thanks so much for your response.

I tried to lose the quotes at the end, but the they were automatically put
back in?


--
S


Maurice said:
Two options:

first try:

stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]
lose the double quotes at the end

second:

Your filter could reference the mainform. The way it is setup now it's
referencing the subform. try:

stLinkCriteria = "[ProgressID]" = " & Me.parent![ProgressID]
--
Maurice Ausum


Sharon said:
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.
 
S

Sharon

Klatuu, I appreciate your response but it won't let me have a continuous
form with a subform. See the "depiction" below which hopefully will give you
a better idea of what I am trying to do.


frmToDo - Prepare and file a certain document
a. subfrmToDoInstruction - Prepare document
i. Progress Notes - Prepared document on 5/23/07
ii. Progress Notes - Sent draft to attorney for approval
iii. Progress Notes - Received approval on 5/23/07

b. Instruction - File with patent office
i. Progress Notes - Filed with the patent office on 5/24/07

c. Instruction - Copies to Client
i. Progress Notes - Copies have been sent to all of the clients
ii. Progress Notes - Copy in the file and indexed.




--
S


Klatuu said:
to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
--
Dave Hargis, Microsoft Access MVP


Sharon said:
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.
 
S

Sharon

Klatuu, I have substituted the strLinkCriteria line as you indicated, but I
keep getting the error message: Syntax error (missing operator) in query
expression '[ProgressID]='. btw - Progress ID is an autonumber. Thanks.
--
S


Klatuu said:
should be:
stLinkCriteria = "[ProgressID] = " & Me![ProgressID]
Assuming [ProgressID] is a numeric field. If it is a text field, it would be:
stLinkCriteria = "[ProgressID] = '" & Me![ProgressID] & "'"
--
Dave Hargis, Microsoft Access MVP


Sharon said:
Maurice, thanks so much for your response.

I tried to lose the quotes at the end, but the they were automatically put
back in?


--
S


Maurice said:
Two options:

first try:

stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]
lose the double quotes at the end

second:

Your filter could reference the mainform. The way it is setup now it's
referencing the subform. try:

stLinkCriteria = "[ProgressID]" = " & Me.parent![ProgressID]
--
Maurice Ausum


:

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.
 
K

Klatuu

Post the code you are actually using, please.
--
Dave Hargis, Microsoft Access MVP


Sharon said:
Klatuu, I have substituted the strLinkCriteria line as you indicated, but I
keep getting the error message: Syntax error (missing operator) in query
expression '[ProgressID]='. btw - Progress ID is an autonumber. Thanks.
--
S


Klatuu said:
should be:
stLinkCriteria = "[ProgressID] = " & Me![ProgressID]
Assuming [ProgressID] is a numeric field. If it is a text field, it would be:
stLinkCriteria = "[ProgressID] = '" & Me![ProgressID] & "'"
--
Dave Hargis, Microsoft Access MVP


Sharon said:
Maurice, thanks so much for your response.

I tried to lose the quotes at the end, but the they were automatically put
back in?


--
S


:

Two options:

first try:

stLinkCriteria = "[ProgressID]" = " & Me![ProgressID]
lose the double quotes at the end

second:

Your filter could reference the mainform. The way it is setup now it's
referencing the subform. try:

stLinkCriteria = "[ProgressID]" = " & Me.parent![ProgressID]
--
Maurice Ausum


:

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.
 
S

Sharon

This is the code for the command button.

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
--
S


Klatuu said:
to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
--
Dave Hargis, Microsoft Access MVP


Sharon said:
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.
 
K

Klatuu

What is the value of Me!ProgressID at the time of assignment?

Put a breakpoint on this line:
DoCmd.OpenForm stDocName, , , stLinkCriteria
run the code. When it gets to this line, see what the value of
strLinkCriteria is.

--
Dave Hargis, Microsoft Access MVP


Sharon said:
This is the code for the command button.

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
--
S


Klatuu said:
to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
--
Dave Hargis, Microsoft Access MVP


Sharon said:
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.
 
S

Sharon

"[ProgressID]= "
--
S


Klatuu said:
What is the value of Me!ProgressID at the time of assignment?

Put a breakpoint on this line:
DoCmd.OpenForm stDocName, , , stLinkCriteria
run the code. When it gets to this line, see what the value of
strLinkCriteria is.

--
Dave Hargis, Microsoft Access MVP


Sharon said:
This is the code for the command button.

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
--
S


Klatuu said:
to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
--
Dave Hargis, Microsoft Access MVP


:

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.
 
K

Klatuu

That means there is nothing in Me![ProgressID]
--
Dave Hargis, Microsoft Access MVP


Sharon said:
"[ProgressID]= "
--
S


Klatuu said:
What is the value of Me!ProgressID at the time of assignment?

Put a breakpoint on this line:
DoCmd.OpenForm stDocName, , , stLinkCriteria
run the code. When it gets to this line, see what the value of
strLinkCriteria is.

--
Dave Hargis, Microsoft Access MVP


Sharon said:
This is the code for the command button.

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
--
S


:

to link the subform data to the mainform data, use the Link Master/Child
fields properties of the subform controls. Rather than a button to open the
3rd table, why not a sub form for the sub form? It is allowed.
--
Dave Hargis, Microsoft Access MVP


:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top