By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,964 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,964 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
> 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.