N
Nick Mirro
Button "btnScript" is located on one of the "come from" form's subforms.
I'd like to use btnScript to open a parent form "frmProcMusSkel" and have
one of its specific subform records be displayed.
**So parentmost form keys need to be linked first, followed by subform keys
(I think)**
ParentToLink SubFormToLink
(Come from form)
Name frmInjuryInfo sbfrmVisit
Level 1 3
Primary key PatientID VisitID
(Go to form)
Name frmProcMusSkel sbfrmBilling
Level 1 2
Primary key PatientID VisitID
Here's what I have, which naturally doesn't work ]:~(
Private Sub btnScript_Click()
On Error GoTo Err_btnScript_Click
Dim frm As Form
DoCmd.OpenForm "frmProcMusSkel", _
WhereCondition:="PatientID=" & Forms!frmInjuryInfo.PatientID
Set frm = Forms!frmProcMusSkel!sbfrmBilling.Form
With frm.RecordsetClone
.FindFirst "VisitID=" & Me.VisitID
If Not .nomatch Then
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
Exit_btnScript_Click:
Exit Sub
Err_btnScript_Click:
MsgBox Err.Description
Resume Exit_btnScript_Click
End Sub
How can I correct this to work properly, short of taking a desparately need
vb course?
Nick
I'd like to use btnScript to open a parent form "frmProcMusSkel" and have
one of its specific subform records be displayed.
**So parentmost form keys need to be linked first, followed by subform keys
(I think)**
ParentToLink SubFormToLink
(Come from form)
Name frmInjuryInfo sbfrmVisit
Level 1 3
Primary key PatientID VisitID
(Go to form)
Name frmProcMusSkel sbfrmBilling
Level 1 2
Primary key PatientID VisitID
Here's what I have, which naturally doesn't work ]:~(
Private Sub btnScript_Click()
On Error GoTo Err_btnScript_Click
Dim frm As Form
DoCmd.OpenForm "frmProcMusSkel", _
WhereCondition:="PatientID=" & Forms!frmInjuryInfo.PatientID
Set frm = Forms!frmProcMusSkel!sbfrmBilling.Form
With frm.RecordsetClone
.FindFirst "VisitID=" & Me.VisitID
If Not .nomatch Then
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
Exit_btnScript_Click:
Exit Sub
Err_btnScript_Click:
MsgBox Err.Description
Resume Exit_btnScript_Click
End Sub
How can I correct this to work properly, short of taking a desparately need
vb course?
Nick