473,406 Members | 2,217 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,406 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 2476
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: SELECT PrimaryKeyColumn FROM INSERTED opposed...
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 trigger is as below : CREATE TRIGGER foo NO...
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 new database and I run into the followin strange...
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 automagically. Hope someone finds this as useful as...
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 a subform on a subform. For example, on my...
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 record stand out (color or font change, size, etc) from...
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 force, district, territory, sales rep are the...
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 subform. Is it possible to go to the offending...
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 understand. Basically, I have a main form which...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.