B
bmagnuso
One form gets a user-selected item from a list box:
-----
Private Sub click_get_po_item_Click()
Dim sGen As String
Dim stLinkCriteria As String
Dim stDocName As String
Dim iRet As Integer
If IsNull(Me![po_num_sel]) = True Then
sGen = "Please highlight a PO from the list!"
iRet = MsgBox(sGen, 32, "No PO Selected")
GoTo ExitSubLoc
End If
stLinkCriteria = "[po_num]=" & Me![po_num_sel] 'set up to find the
record desired
stDocName = "mf3"
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, acWindowNormal,
stLinkCriteria
ExitSubLoc:
End Sub
-----
The called form checks for open arguments to do a find-first to that record:
-----
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Forms![mf3].OpenArgs) Then
Dim strQueryOnID As String
Dim rs As DAO.Recordset
strQueryOnID = Forms![mf3].OpenArgs
Set rs = Forms![mf3].RecordsetClone
rs.FindFirst strQueryOnID
If Not rs.NoMatch Then
Forms![mf3].Bookmark = rs.Bookmark
End If
End If
End Sub
------
At the "Forms![mf3].Bookmark line, the 2465 run-time error occurs with the
USELESS
ERROR MESSAGE "can't find the field 'Forms' referred".
I can't myself find any field "Forms" anywhere. HELP!
Thanks!
-----
Private Sub click_get_po_item_Click()
Dim sGen As String
Dim stLinkCriteria As String
Dim stDocName As String
Dim iRet As Integer
If IsNull(Me![po_num_sel]) = True Then
sGen = "Please highlight a PO from the list!"
iRet = MsgBox(sGen, 32, "No PO Selected")
GoTo ExitSubLoc
End If
stLinkCriteria = "[po_num]=" & Me![po_num_sel] 'set up to find the
record desired
stDocName = "mf3"
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, acWindowNormal,
stLinkCriteria
ExitSubLoc:
End Sub
-----
The called form checks for open arguments to do a find-first to that record:
-----
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Forms![mf3].OpenArgs) Then
Dim strQueryOnID As String
Dim rs As DAO.Recordset
strQueryOnID = Forms![mf3].OpenArgs
Set rs = Forms![mf3].RecordsetClone
rs.FindFirst strQueryOnID
If Not rs.NoMatch Then
Forms![mf3].Bookmark = rs.Bookmark
End If
End If
End Sub
------
At the "Forms![mf3].Bookmark line, the 2465 run-time error occurs with the
USELESS
ERROR MESSAGE "can't find the field 'Forms' referred".
I can't myself find any field "Forms" anywhere. HELP!
Thanks!