467,135 Members | 1,220 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,135 developers. It's quick & easy.

Subform Getting Parent's Current Record & VB Events....

Hi,
I have a form that is designed as a data sheet view. Attached to this
is a subform with some VB code. When the user clicks on a row, the
subform should pop up and run the VB code which accesses the record
corresponding to the row clicked.

To get this row, I tried using Me.Parent.Bookmark. Unfortunately,
this gets the "Current Record" which is set via the navigation
buttons. While the user can click on the navigation buttons to get to
the "Current Record", it's very inconvenient to do so.

How can I use VB in a subform to get the record corresponding to the
row that was clicked to activate the aforementioned subform?

In addition, what subform event will run each time the "+" in a
datasheet view is clicked? I tried the Load, Connect, and half a
dozen other events, but they all only run the first time a subform is
invoked.
Thanks in Advance.
Nov 13 '05 #1
  • viewed: 3409
Share:
1 Reply
> How can I use VB in a subform to get the record corresponding to the
row that was clicked to activate the aforementioned subform?

In addition, what subform event will run each time the "+" in a
datasheet view is clicked? I tried the Load, Connect, and half a
dozen other events, but they all only run the first time a subform is
invoked.
Responding to my own post here. After messing around with events, I
could not find a way to do either of the above, so instead I
implemented them manually and they appear to work.

Here's what I did:

1) I overrode the OnClick event of every data control in the datasheet
form. Each override did the same thing -- it spawned another form.
Any information to be communicated to the form was stored in a
temporary table.

2) I overrode the spawned form's Load event to pick up the data from
the table written in step 1.

3) I got rid of the "real" subforms.

This method works nicely because the user can click on any column and
still get the subform. On the other hand, on the first load the
subform pops up and trying to pop up multiple subforms doesn't quite
work as expected; ditto for scrolling on the datasheet. Both are
pretty minor irritations and I can live with them for now.


Thanks in Advance.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by DD | last post: by
reply views Thread by (Pete Cresswell) | last post: by
3 posts views Thread by matthewemiclea@eaton.com | last post: by
2 posts views Thread by Bill Stock | last post: by
1 post views Thread by troy_lee@comcast.net | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.