S
Song Su
In my frmPO, I have cmdOffice. On click:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOffice"
stLinkCriteria = "[OfficeID]=" & Me!OfficeID
DoCmd.OpenForm stDocName, , , , , , stLinkCriteria
On my frmOffice, on open event, I have:
Dim rst As DAO.Recordset
If IsNull(Me.OpenArgs) Then Exit Sub
Set rst = Me.RecordsetClone
rst.FindFirst Me.OpenArgs
If Not rst.NoMatch Then Me.Bookmark = rst.Bookmark
Set rst = Nothing
This works fine if 'frmOffice' is not open before clicking cmdOffice on
frmPO. If frmOffice is already open, code
will not run as it is in open event. How to modify code so it will find the
record in
'frmOffice' if it is already opened as well as it has not opened before
clicking cmdOffice on frmPO?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOffice"
stLinkCriteria = "[OfficeID]=" & Me!OfficeID
DoCmd.OpenForm stDocName, , , , , , stLinkCriteria
On my frmOffice, on open event, I have:
Dim rst As DAO.Recordset
If IsNull(Me.OpenArgs) Then Exit Sub
Set rst = Me.RecordsetClone
rst.FindFirst Me.OpenArgs
If Not rst.NoMatch Then Me.Bookmark = rst.Bookmark
Set rst = Nothing
This works fine if 'frmOffice' is not open before clicking cmdOffice on
frmPO. If frmOffice is already open, code
will not run as it is in open event. How to modify code so it will find the
record in
'frmOffice' if it is already opened as well as it has not opened before
clicking cmdOffice on frmPO?