M
Mishanya
I have frmMain with frmSub1 (datasheet view) and frmSub2 (single view, set to
invisible). Both suforms are linked to the frmMain by the ClientID field and
have OrderID in their underlying queries.
I want to turn frmSub2 visible by double-clicking OrderDate-cell on frmSub1,
so frmSub2 would appear on the screen (as part of the same main form) with
the same record-set as the clicked one.
So far I've been able to turn frmSub2 visible without setting criteria
(turns visible with paging option):
Private Sub OrderDate_DblClick(Cancel As Integer)
Forms![frmMain]![frmSub2].Visible = Not Forms![frmMain]![frmSub2].Visible
End Sub
or seting the criteria allright though opening frmSub2 in the new window
(opens filtered with only one page):
Private Sub OrderDate_DblClick(Cancel As Integer)
On Error GoTo Err_OrderDate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSub2"
stLinkCriteria = "[OrderID]=" & Me![OrderID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OrderDate_Click:
Exit Sub
Err_OrderDate_Click:
MsgBox Err.Description
End Sub
I'll appriciate help with combining those two: setting the criteria for
frmSub2 as
the OrderID record-set of the clicked record and visualisation it in the same
frmMain.
invisible). Both suforms are linked to the frmMain by the ClientID field and
have OrderID in their underlying queries.
I want to turn frmSub2 visible by double-clicking OrderDate-cell on frmSub1,
so frmSub2 would appear on the screen (as part of the same main form) with
the same record-set as the clicked one.
So far I've been able to turn frmSub2 visible without setting criteria
(turns visible with paging option):
Private Sub OrderDate_DblClick(Cancel As Integer)
Forms![frmMain]![frmSub2].Visible = Not Forms![frmMain]![frmSub2].Visible
End Sub
or seting the criteria allright though opening frmSub2 in the new window
(opens filtered with only one page):
Private Sub OrderDate_DblClick(Cancel As Integer)
On Error GoTo Err_OrderDate_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmSub2"
stLinkCriteria = "[OrderID]=" & Me![OrderID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OrderDate_Click:
Exit Sub
Err_OrderDate_Click:
MsgBox Err.Description
End Sub
I'll appriciate help with combining those two: setting the criteria for
frmSub2 as
the OrderID record-set of the clicked record and visualisation it in the same
frmMain.