Navigate to specific record in parent form from subform

R

RDResearch

I have a subform that does not use child links wit a parent form. I would
like to navigate to a specific record in the parent form via the subform. I
would think it would involve an OnClick code in the subform but I haven't
been able to find any references in Help nor in the office community.
Thank you.
 
R

ruralguy via AccessMonster.com

If your SubForm is a Continuous Form then you cah use the OnCurrent event of
the SubForm.
 
R

RDResearch

Thank you. Now that I've thought about it, what I really need to use is
OnClick in a specific field in the subform because I need to display the
subform as a datasheet. Would you be able to help with the coding? I only
know how to do this much:

Private Sub Index_Click()

End Sub

The parent form is called PT Entry. The primary key field is called Index.

Thank you again.
 
R

ruralguy via AccessMonster.com

A Current event is triggered whenever you enter a different record, even when
the form is in DataSheet mode. You don't get another Current event when you
select another control in the same record. That is why I suggested the
Current event for your code. Are you trying to move the Bookmark of the
MainForm RecordSet to the record that has a PrimaryKey equal to your
SubForm's Index field? Do both the MainForm and the SubForm have fields
named Index? Poor choice of a field name.

Using reserved words as names for your objects *will* give you unexpected
grief!
http://support.microsoft.com/?id=321266
http://support.microsoft.com/?id=286335
http://support.microsoft.com/?id=826763

It also becomes much easier to read code if you assign a name to a control
the is different than the field to which it is bound. Here's one similar to
what I use:
http://www.acc-technology.com/namconv.htm

Thank you. Now that I've thought about it, what I really need to use is
OnClick in a specific field in the subform because I need to display the
subform as a datasheet. Would you be able to help with the coding? I only
know how to do this much:

Private Sub Index_Click()

End Sub

The parent form is called PT Entry. The primary key field is called Index.

Thank you again.
If your SubForm is a Continuous Form then you cah use the OnCurrent event of
the SubForm.
[quoted text clipped - 4 lines]
 
Top