F
Fred Boer
Hello!
I have two related forms: Frm_LibraryDataEdit and Frm_LibraryDataFilter. The
first displays book information for editing. The second displays book
information for searching. There is a command button on each form which will
open the related form, and position the related form to the same record as
the calling form. This works fine, using OpenArgs, if the form being called
is not already open.
However, if the form being called *is* already open, I can't seem to
synchronize it to the calling form. I include the code below. I have
confirmed that the IsLoaded( ) function is returning the proper value, and
the the correct Book_ID is available to the FindFirst command.
1. If I am calling a form which is already open, is "DoCmd.OpenForm" the
appropriate command?
2. What is wrong with my code?
Thanks!
Fred Boer
(Isloaded( ) is the standard function from Northwind Traders.)
If ISLOADED("Frm_LibraryDataFilter") Then
DoCmd.OpenForm ("Frm_LibraryDataFilter")
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Book_ID] = " & _
Forms!Frm_LibraryDataEdit!txtBook_ID
Me.Bookmark = rs.Bookmark
Else
DoCmd.OpenForm ( _
"Frm_LibraryDataFilter"), _
OpenArgs:="Book_ID= " & Me!txtBook_ID
End If
I have two related forms: Frm_LibraryDataEdit and Frm_LibraryDataFilter. The
first displays book information for editing. The second displays book
information for searching. There is a command button on each form which will
open the related form, and position the related form to the same record as
the calling form. This works fine, using OpenArgs, if the form being called
is not already open.
However, if the form being called *is* already open, I can't seem to
synchronize it to the calling form. I include the code below. I have
confirmed that the IsLoaded( ) function is returning the proper value, and
the the correct Book_ID is available to the FindFirst command.
1. If I am calling a form which is already open, is "DoCmd.OpenForm" the
appropriate command?
2. What is wrong with my code?
Thanks!
Fred Boer
(Isloaded( ) is the standard function from Northwind Traders.)
If ISLOADED("Frm_LibraryDataFilter") Then
DoCmd.OpenForm ("Frm_LibraryDataFilter")
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Book_ID] = " & _
Forms!Frm_LibraryDataEdit!txtBook_ID
Me.Bookmark = rs.Bookmark
Else
DoCmd.OpenForm ( _
"Frm_LibraryDataFilter"), _
OpenArgs:="Book_ID= " & Me!txtBook_ID
End If