G
Guest
I have an unbound main form (frmProjects) with several tabs: Home, Studies,
Manuscripts, etc. Each tab has a different subform. On the Studies tab is a
subform (fsubStudies) which shows studies; on the Manuscripts tab is a
subform (fsubManuscripts) which shows manuscripts, etc. On the Home tab is a
continuous subform (fsubProjectList) which shows a list of all Projects.
See screenshot: http://members.cox.net/kheisler6/frmProjects.jpg
I would like to click on a project listed on the Home tab’s ProjectList
subform and move the focus to the appropriate subform (one on of several
tabs) and the appropriate record on the subform. For example, when the user
clicks a project on the fsubProjectList:
- If ProjectType = “Study,†go to the Studies tab and go to the appropriate
record (i.e., with matching ProjectID) on the Study subform.
- If ProjectType = “Manuscript,†go to the Manuscript tab and go to the
appropriate record (i.e., with matching ProjectID) on the Manuscript subform.
And so forth.
I tried putting code in the On Click event of the ProjectTitle which sets
the focus to the appropriate tab/subform and then finds the matching record:
###
Private Sub ProjectTitle_Click()
If Me.ProjectTypeID.Value = "Study" Then
' set focus on subform/tab
Me.Parent!pgStudies.SetFocus
' go to matching record
Me.DoCmd.OpenForm "fsubStudies", , , "[ProjectID] = " &
Forms![fsubProjectList]![ProjectID]
ElseIf Me.ProjectTypeID.Value = "Manuscript" Then
'...
End If
###
But this gives me a Compile error: Method or data member not found, which
highlights the last [ProjectID] in the main SQL statement.
What am I doing wrong? Thanks.
- Kurt
Manuscripts, etc. Each tab has a different subform. On the Studies tab is a
subform (fsubStudies) which shows studies; on the Manuscripts tab is a
subform (fsubManuscripts) which shows manuscripts, etc. On the Home tab is a
continuous subform (fsubProjectList) which shows a list of all Projects.
See screenshot: http://members.cox.net/kheisler6/frmProjects.jpg
I would like to click on a project listed on the Home tab’s ProjectList
subform and move the focus to the appropriate subform (one on of several
tabs) and the appropriate record on the subform. For example, when the user
clicks a project on the fsubProjectList:
- If ProjectType = “Study,†go to the Studies tab and go to the appropriate
record (i.e., with matching ProjectID) on the Study subform.
- If ProjectType = “Manuscript,†go to the Manuscript tab and go to the
appropriate record (i.e., with matching ProjectID) on the Manuscript subform.
And so forth.
I tried putting code in the On Click event of the ProjectTitle which sets
the focus to the appropriate tab/subform and then finds the matching record:
###
Private Sub ProjectTitle_Click()
If Me.ProjectTypeID.Value = "Study" Then
' set focus on subform/tab
Me.Parent!pgStudies.SetFocus
' go to matching record
Me.DoCmd.OpenForm "fsubStudies", , , "[ProjectID] = " &
Forms![fsubProjectList]![ProjectID]
ElseIf Me.ProjectTypeID.Value = "Manuscript" Then
'...
End If
###
But this gives me a Compile error: Method or data member not found, which
highlights the last [ProjectID] in the main SQL statement.
What am I doing wrong? Thanks.
- Kurt