M
Mishanya
I have frmMain with frmSub1 (datasheet) and frmSub2 (single, 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 and OrderID-wise filter it by double-clicking
OrderDate value on frmSub1.
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
Please help with combining those two: setting the criteria for frmSub2 as
the OrderID value 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 and OrderID-wise filter it by double-clicking
OrderDate value on frmSub1.
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
Please help with combining those two: setting the criteria for frmSub2 as
the OrderID value of the clicked record and visualisation it in the same
frmMain.