open args and subforms

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
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Open and goto same ID on subform 11
Arrays 2
How to remove a filter 7
subforms 5
Go to a new record on another form? 6
Problem with opening subform 5
Using combo box to select record source 1
openform with gotfocus 4

Top