G
Guest
Hi,
I am passing two field values from form1 to form2 using OpenArgs.
I am then splitting the OpenArgs in the onLoad event of form2 and assinging
the values to two variables, 'strPerID' and 'strSessID'.
Variable 1, 'strPerID', is used to find the relevant record in Form2 using
FirdFirst and BookMark. All ok so far.
Form2 has a subform, 'fsubSession ' on a tab control, 'tabCtrl', on a
page, 'pgeSession'.
I want to set the focus to the subform and go to the record with the same
value as the second value of the split OpenArg, I passed from form1 - now
stored in 'strSessID'.
I get as far as seting the focus to the subform on form2 but am stuck
getting the relevent record to be highlighted.
Here is my code on Form2.
Dim MyOpenArgsArray
Dim rs As Object
Dim strPerID As String
Dim strSessID As String
MyOpenArgsArray = Array()
MyOpenArgsArray = Split(OpenArgs, "-")
strPerID = MyOpenArgsArray(0)
strSessID = MyOpenArgsArray(1)
Set rs = Me.Recordset.Clone
rs.FindFirst "[PersonID] = " & strPerID
Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "tabCtrl"
Me.pgeSession.SetFocus
Me.fsubSession.SetFocus
??
The relevant field on the subform I want to match with 'strSessID' is
called 'SessionID'
Thanks
nB
I am passing two field values from form1 to form2 using OpenArgs.
I am then splitting the OpenArgs in the onLoad event of form2 and assinging
the values to two variables, 'strPerID' and 'strSessID'.
Variable 1, 'strPerID', is used to find the relevant record in Form2 using
FirdFirst and BookMark. All ok so far.
Form2 has a subform, 'fsubSession ' on a tab control, 'tabCtrl', on a
page, 'pgeSession'.
I want to set the focus to the subform and go to the record with the same
value as the second value of the split OpenArg, I passed from form1 - now
stored in 'strSessID'.
I get as far as seting the focus to the subform on form2 but am stuck
getting the relevent record to be highlighted.
Here is my code on Form2.
Dim MyOpenArgsArray
Dim rs As Object
Dim strPerID As String
Dim strSessID As String
MyOpenArgsArray = Array()
MyOpenArgsArray = Split(OpenArgs, "-")
strPerID = MyOpenArgsArray(0)
strSessID = MyOpenArgsArray(1)
Set rs = Me.Recordset.Clone
rs.FindFirst "[PersonID] = " & strPerID
Me.Bookmark = rs.Bookmark
DoCmd.GoToControl "tabCtrl"
Me.pgeSession.SetFocus
Me.fsubSession.SetFocus
??
The relevant field on the subform I want to match with 'strSessID' is
called 'SessionID'
Thanks
nB