D
Daniel
Appearantly I have a lot of questions today!
I need to have an event that will 1 goto a specific frm record and then goto
a specific subfrm record. I have a functional code for the 1st part (goto
specific frm record) but am encountering problems with the latter. Below is
the code that I have thus far:
***
Private Sub lstRptNum_DblClick(Cancel As Integer)
Dim ctlList As Control
Dim varItem As Variant
Dim strRptNumID As String
Dim strRptIssueID As String
Dim strRptNum As String
Dim strRptIssue As String
'Return Control object variable pointing to list box.
Set ctlList = Me.lstRptNum
'Enumerate through selected items.
For Each varItem In ctlList.ItemsSelected
' Print value of bound column.
strRptNum = ctlList.Column(0, varItem)
strRptIssue = ctlList.Column(1, varItem)
Forms![Stress Reports Frm].Form.[Stress Report Number Lookup] =
strRptNum
Next varItem
'Goto Specific Report Number
Call Forms("Stress Reports Frm").Stress_Report_Lookup_Button_Click
'Goto Specific Report Issue
Dim rs As Object
strRptNumID = DLookup("[Stress Report ID]", "Stress Reports - General
Info Tbl", "[Stress Report Number]='" & strRptNum & "'")
strRptIssueID = DLookup("[Stress Report Issue AutoNumber]", "Stress
Reports - Issue Info Tbl", "[Stress Report AutoNumber] =" & strRptNumID & "
AND [Stress Report Issue]='" & strRptIssue & "'")
Set rs = Forms![Stress Reports Frm].[Stress Reports Frm - Issue
SubFrm].RecordsetClone
'Forms![Stress Reports Frm].[Stress Reports Frm - Issue SubFrm].
rs.FindFirst "[Stress Report Issue AutoNumber]=" & strRptIssueID
If rs.NoMatch Then
MsgBox "Unable to locate Stress Report Number " & strRptNum & "." &
vbCrLf & "Please verify the Stress Report Number and try again.",
vbInformation, "Stress Report Number Not Found"
Else
Forms![Stress Reports Frm].[Stress Reports Frm - Issue
SubFrm].Bookmark = rs.Bookmark
End If
End Sub
***
I am currently getting an error with the set rs line stating that it does
not support this method? If this is the case, then how can I retrieve the
subfrm record where "[Stress Report Issue AutoNumber]=" & strRptIssueID?
Thank you,
Daniel
I need to have an event that will 1 goto a specific frm record and then goto
a specific subfrm record. I have a functional code for the 1st part (goto
specific frm record) but am encountering problems with the latter. Below is
the code that I have thus far:
***
Private Sub lstRptNum_DblClick(Cancel As Integer)
Dim ctlList As Control
Dim varItem As Variant
Dim strRptNumID As String
Dim strRptIssueID As String
Dim strRptNum As String
Dim strRptIssue As String
'Return Control object variable pointing to list box.
Set ctlList = Me.lstRptNum
'Enumerate through selected items.
For Each varItem In ctlList.ItemsSelected
' Print value of bound column.
strRptNum = ctlList.Column(0, varItem)
strRptIssue = ctlList.Column(1, varItem)
Forms![Stress Reports Frm].Form.[Stress Report Number Lookup] =
strRptNum
Next varItem
'Goto Specific Report Number
Call Forms("Stress Reports Frm").Stress_Report_Lookup_Button_Click
'Goto Specific Report Issue
Dim rs As Object
strRptNumID = DLookup("[Stress Report ID]", "Stress Reports - General
Info Tbl", "[Stress Report Number]='" & strRptNum & "'")
strRptIssueID = DLookup("[Stress Report Issue AutoNumber]", "Stress
Reports - Issue Info Tbl", "[Stress Report AutoNumber] =" & strRptNumID & "
AND [Stress Report Issue]='" & strRptIssue & "'")
Set rs = Forms![Stress Reports Frm].[Stress Reports Frm - Issue
SubFrm].RecordsetClone
'Forms![Stress Reports Frm].[Stress Reports Frm - Issue SubFrm].
rs.FindFirst "[Stress Report Issue AutoNumber]=" & strRptIssueID
If rs.NoMatch Then
MsgBox "Unable to locate Stress Report Number " & strRptNum & "." &
vbCrLf & "Please verify the Stress Report Number and try again.",
vbInformation, "Stress Report Number Not Found"
Else
Forms![Stress Reports Frm].[Stress Reports Frm - Issue
SubFrm].Bookmark = rs.Bookmark
End If
End Sub
***
I am currently getting an error with the set rs line stating that it does
not support this method? If this is the case, then how can I retrieve the
subfrm record where "[Stress Report Issue AutoNumber]=" & strRptIssueID?
Thank you,
Daniel