Tough One (1 Viewer)

jca

I need to think it over !
Local time
Today, 05:52
Joined
Aug 1, 2001
Messages
42
Hi,
I've been away from Access for a while but now I'm back in action :) . Maybe I'm rusty from the lack of practice but I think this one will be hard to resolve. So here it is:

I have a form in datasheet presentation and when I double-click on a record, I need to open another form. This I can easly do, now for the hard part, the form I must open has two tabs, one for a specific region and another for the rest of the world. I want to make the sub-form point to the concern record, which I can easily know, from the first form. So, basicly, I need to make a sub-form point to a record from another form.

Currently, I can open the sub-form alone, without going through the parent form, but I can't make it point to the concern record. I can use the "where" clause of the "docmd.openform" command but I would like the form to just be on the concern record and still have access to the entire recordset.

Well, that's about it. I told you it was going to be a hard one, well I still think it's hard :) .

Maybe a little code snippet would help:

Code:
Private Sub PEIN_DblClick(Cancel As Integer)
Dim MemberID As Long
Dim ComputerID As Long

MemberID = Me.MemberID
ComputerID = Me.ComputerID

If Me.Region = "ON" Then
    'This is where I don't know how to do it
    'I tried a "OpenForm" but I can only access the parent form
    'And not the sub-form
Else
    
End If
End Sub

If you need more infos to help me, please don't hesitate to ask, I'll be monitoring my e-mail box closely :D .

Thx,
JCA
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:52
Joined
Aug 30, 2003
Messages
36,130
Here's a sample from a test db. You should be able to adapt it to refer to the subform:

Code:
  Dim rs               As Object

  DoCmd.OpenForm "frmEmployee"

  Set rs = Forms!frmEmployee.RecordsetClone
  rs.FindFirst "[ID] = " & Me.txtLast
  Forms!frmEmployee.Bookmark = rs.Bookmark
 

jca

I need to think it over !
Local time
Today, 05:52
Joined
Aug 1, 2001
Messages
42
Thank you for your quick reply.

I still have a question thou. How can I make a RecordsetClone of the sub-form?

Thx,
JC
 

jca

I need to think it over !
Local time
Today, 05:52
Joined
Aug 1, 2001
Messages
42
Oups, should I've though about it a little bit more. I just have to add a .Form before .RecordsetClone and .Bookmark for it to work... :eek:

Anyway, thanks again pbaldy for you quick reply.

JC
 

Users who are viewing this thread

Top Bottom