Linking a sub form and a Pop Up Form

G

Guest

Hi,

I have a mainform and a subform (these two forms are NOT linked).

When a selection is made on the main form, it gets added to the subform (the
subform only lists very basic details).

What I am trying to do is when the user double clicks a record in the
subform, a pop up form will open at the same record which the user clicked on
in the sub form.

This is the code that I treid to use and it did not work:

rivate Sub Form_DblClick(Cancel As Integer)

With Me.RecordsetClone
currID = Me.Bookmark
End With

stLinkCriteria = "[ID] = " & currID

DoCmd.OpenForm "frm_BkpExec_Ntepad", , , stLinkCriteria

End Sub

Any assistance would be greatly appreciated.

Cheers,
GLT.
 
A

Albert D. Kallal

Just use:

DoCmd.OpenForm "frm_BkpExec_Ntepad", , , "id = " & me!id


If you allow any editing in the sub-form, then you better commit any changes
to disk BEFORE you launch the above form.

So,

if me.dirty = true then
me.Dirty = false
end if

DoCmd.OpenForm "frm_BkpExec_Ntepad", , , "id = " & me!id



"me.bookmark" returns a string value, and is only good for the current
reocrdset clone, it can't be used else where, or for other forms that you
open..the bookmark would not be valid anyway.

And, further more, you need to use a criteria as above...a bookmark does not
give you the record "id", or any other value that you can use "over" time to
resolve to a particular record. Use the PK value as above....
 

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

Top