472,353 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Trigger an action by highlighting a row in a subform

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
identifiers, since there would be too many to be able to display). The
user specifies criteria on the form, which narrows down the number of
records shown in the subform. Underneath the subform, there is another
subform that consists of 25 fields, but displayed in form view as
opposed to datasheet view(this way, only one record is shown at a time,
but I can display more data on the single form. Is there any way that
someone can simply highlight one of the many records from the first
subform, and the info for the fields specific to that record will then
be shown in the other subform??? This was hard to explain, so I hope
it makes sense.

Thanks,

Matt

Nov 13 '05 #1
3 2394
On 1 Mar 2005 12:16:07 -0800, ma************@eaton.com wrote:
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
identifiers, since there would be too many to be able to display). The
user specifies criteria on the form, which narrows down the number of
records shown in the subform. Underneath the subform, there is another
subform that consists of 25 fields, but displayed in form view as
opposed to datasheet view(this way, only one record is shown at a time,
but I can display more data on the single form. Is there any way that
someone can simply highlight one of the many records from the first
subform, and the info for the fields specific to that record will then
be shown in the other subform??? This was hard to explain, so I hope
it makes sense.

Thanks,

Matt


Yes - it can be done, but you have to watch for contention issues between the
subforms if editing is allowed on both (or somethines even if it isn't).

The Current event fires on a form each time you move to a new record, and you
can use that to trigger a re-sync of the other subform. There are 2 gotchas
here, though.

1. Subforms are initialized before the parent forms, so your code can crash
the first time you try to process the Current event on the subform.

2. Sometimes, the Current event can fire before the recordset is opened, so
your Current event handler can crash trying to read data from the current
record the first time it fires.

I'll post back later when I have more time about strategies for working around
these gotchas.
Nov 13 '05 #2
ma************@eaton.com wrote in
news:11**********************@o13g2000cwo.googlegr oups.com:
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 identifiers, since there would be too many to be
able to display). The user specifies criteria on the form,
which narrows down the number of records shown in the subform.
Underneath the subform, there is another subform that
consists of 25 fields, but displayed in form view as opposed
to datasheet view(this way, only one record is shown at a
time, but I can display more data on the single form. Is
there any way that someone can simply highlight one of the
many records from the first subform, and the info for the
fields specific to that record will then be shown in the other
subform??? This was hard to explain, so I hope it makes
sense.

Thanks,

Matt

Try this: On the main form create a textbox. It can be invisible,
it will still work. In the first subform set the On Current event
to put the Primary key of the record into the textbox*. Now Set
the Link Master Fields property of the second subform to the
textbox on the parent form. and the Link Child Fields to the
foreign key in your subform.If you don't want to use the on
current event, use the on click events of each field AND of the
detail section of the form

*parent!txtbox.value=me!pkfield.value is what I use, with names
adjusted to suit..

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3
So I did exactly what you said. I created the On Current command of the
first form, which sets the value of an unbounded text box on the main
form. I then linked the unbounded text box to the foreign key of the
second subform. After doing this, I can highlight a record on the first
form, and its key value will appear in the text box. However, the
second subform does not change at all. Any Ideas?
Matt

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Scott CM | last post by:
I have a multi-part question regarding trigger performance. First of all, is there performance gain from issuing the following within a trigger: ...
1
by: Simon Holmes | last post by:
Hi, I am having trouble calling a UDF from a 'before update' trigger whereas I have no problems calling it from the 'after update' trigger. The...
5
by: William of Ockham | last post by:
Hi, I was asked to recreate a new clean database for our developers because the current one they use is not entirely up to date. So I created a...
0
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers...
2
by: kma | last post by:
I am designing an Access 2000 database on a computer running Windows 98. I have one form with several tabs; all of which have sub forms, some with...
3
by: Mark | last post by:
Hi there, I have a subform, set as a continuous form. When a user selects a particular record in that subform, how can I make that particular...
2
by: Paul Malcomson | last post by:
Hi. I'm having terrible trouble with a form that displays several parent/child relationships at one time. It is a sales force hierarchy - Sales...
2
by: Keith Wilby | last post by:
I have developed an appointments system database and I use the attached code in the main form's current event to detect appointment clashes in the...
5
Breezwell
by: Breezwell | last post by:
I have done some searching on this one and I have yet to find any information that sheds light on what I am trying to do. At lease from what I can...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

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.