473,761 Members | 6,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2500
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.goo glegroups.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!pkfiel d.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
6556
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 to: SELECT * FROM INSERTED
1
4076
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 CASCADE
5
4525
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 problem. First some facts: System: DB2 V8.1 Fixpack5 Redhat Linux 8.0 dual processor Database A is the current database and all DDL I currently have executes fine. Database B is the new one and is created on the same instance as A.
0
2477
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 I've found it educational. Note: - I build this for use in a JDEdwards OneWorld environment. I'm not sure how generic others find it but it should be fairly generic. - I use a C stored procedure GETJOBNAME to get some extra audit data,
2
4679
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 main Job form I have a tab for PO's to keep track of all purchase orders pertaining to a specific job. The first subform is for the PO numbers related to the jobs on the main form and the next subform is for all of the PO lines for each PO. ...
3
7918
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 the other records in the list? Thank you in advance, Mark
2
3001
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 tables linked in parent/child relationships. I'm using a form to choose the main-parent and then several subforms in datasheet view.
2
5899
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 record in the subform so as to highlight it? I did originally have this code in the subform but (of course) using the Bookmark property in its Current event made it impossible to move away from the offending record! Many thanks. Keith.
5
9689
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 has a single subform. The subform presents a datasheet view of a a query. The query results present information in such a manner that a single column, call it GroupCode, can have numerous duplicate entries. This is actually desired as a normalized...
0
10115
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.