473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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
1 3706
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DD | last post by:
I want to link a form to another form by a Cmd Button. CustomerID = CustomerID I want the form to open from the Cmd Button as if it was acting in the same way as subform What would be the code?...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
0
by: (Pete Cresswell) | last post by:
I've got a few subforms, each with an accellerator key assigned. When the user presses, for instance, Alt+2, the focus shifts to subform "2". This works OK once the user has selected a record...
3
by: matthewemiclea | last post by:
So I think this may be a stretch, but I have a subform that is displayed on a main form. The subform is based on a query that brings records from a table(It does not bring all fields, but the main...
2
by: Bill Stock | last post by:
I have a subform which is causing a 3314 (Field can't contain a null value because required is set to True) error. I solved this problem by trapping it in the before update event. But then I...
2
by: John | last post by:
I have two tables in a 1:M relationship- the parent has 5 fields in the primary key and the child 6 (these are actually pretty far downstream in a complicated ER model, but the problem is between...
13
by: bitsnbytes64 | last post by:
Hi, I have a form which contains a subform. Both are were creetd using the form wizard and are bound by the column IXO_NR (on two different tables), which is the control source for a textbox on...
1
by: troy_lee | last post by:
I have a table (Table A). It has one field, a PK. It is in a 1:M with another table (Table B). I am having trouble with a form/subform setup to view the 1:M records. On the parent form, there is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.