R
Ruth
I have a "details" button on a continuous form that, when clicked, I
want it to open a specific form based on a value in a combo box. The
continuous form is a subform, which I think may be causing the
problem.
This is the code on the button. It doesn't generate an error, but it
doesn't do anything either. The parent form is frmCell and the subform
is frmCellTasks
Ideas?
Private Sub btnDetails_Click()
On Error GoTo Err_btnDetails_Click
Dim stDocName As String
Dim stLinkCriteria As String
If Me.Task = "Inspection" Then
stDocName = "subInspItem"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me.Task = "Jig Test" Then
stDocName = "subJigMove"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me.Task = "Leak" Then
stDocName = "subLeakItem"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else: MsgBox "This task does not have details.", vbOKOnly
End If
End If
End If
Exit_btnDetails_Click:
Exit Sub
Thanks!
Err_btnDetails_Click:
MsgBox Err.Description
Resume Exit_btnDetails_Click
End Sub
want it to open a specific form based on a value in a combo box. The
continuous form is a subform, which I think may be causing the
problem.
This is the code on the button. It doesn't generate an error, but it
doesn't do anything either. The parent form is frmCell and the subform
is frmCellTasks
Ideas?
Private Sub btnDetails_Click()
On Error GoTo Err_btnDetails_Click
Dim stDocName As String
Dim stLinkCriteria As String
If Me.Task = "Inspection" Then
stDocName = "subInspItem"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me.Task = "Jig Test" Then
stDocName = "subJigMove"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Me.Task = "Leak" Then
stDocName = "subLeakItem"
stLinkCriteria = "[TaskID]=" & Me![TaskID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else: MsgBox "This task does not have details.", vbOKOnly
End If
End If
End If
Exit_btnDetails_Click:
Exit Sub
Thanks!
Err_btnDetails_Click:
MsgBox Err.Description
Resume Exit_btnDetails_Click
End Sub