C
CJ
Hi Groupies:
I have a command button on frmProjectMaster that opens frmReeferMain and
locates the matching record. The problem is that when you use the wizard to
make this happen a filter is applied to the frmReeferMain form and other
searches or navigation do not work on that form.
I am trying to rewrite the code so that frmReeferMain opens with the correct
record, but no filter is applied. I have the correct form opening, but the
correct record does not show.
Can somebody please have a look at my code and help me with the error?!?!
Private Sub cmdViewReefer_Click()
On Error GoTo Err_cmdViewReefer_Click
Dim stDocName As String
Dim rs As Object
Set rs = Me.Recordset.Clone
stDocName = "frmReeferMain"
Set rs = Me.Recordset.Clone
DoCmd.OpenForm stDocName
rs.FindFirst "[lngProjectID] = " &
Str(Nz(Forms!frmProjectMaster.[lngProjectID], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.Close acForm, "frmProjectMaster"
Exit_cmdViewReefer_Click:
Exit Sub
Err_cmdViewReefer_Click:
MsgBox Err.Description
Resume Exit_cmdViewReefer_Click
End Sub
Thanks in Advance
I have a command button on frmProjectMaster that opens frmReeferMain and
locates the matching record. The problem is that when you use the wizard to
make this happen a filter is applied to the frmReeferMain form and other
searches or navigation do not work on that form.
I am trying to rewrite the code so that frmReeferMain opens with the correct
record, but no filter is applied. I have the correct form opening, but the
correct record does not show.
Can somebody please have a look at my code and help me with the error?!?!
Private Sub cmdViewReefer_Click()
On Error GoTo Err_cmdViewReefer_Click
Dim stDocName As String
Dim rs As Object
Set rs = Me.Recordset.Clone
stDocName = "frmReeferMain"
Set rs = Me.Recordset.Clone
DoCmd.OpenForm stDocName
rs.FindFirst "[lngProjectID] = " &
Str(Nz(Forms!frmProjectMaster.[lngProjectID], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.Close acForm, "frmProjectMaster"
Exit_cmdViewReefer_Click:
Exit Sub
Err_cmdViewReefer_Click:
MsgBox Err.Description
Resume Exit_cmdViewReefer_Click
End Sub
Thanks in Advance