Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Update form based on subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Max Moor - 22 May 2007 19:43 GMT
Hi All,
       This is probably a dead simple thing, but I'm stuck on it.

       My main form's record set is dependent on the selection of a record
from one of its subforms.  When the user selects a different record, I need
to requery the main form to update all the other stuff on it that refers to
the selected record in the subform.

       What is the simplest way to detect that a user has selected a different
record in the subform?

       In the past, I've setup OnClick events for all the subform's controls.  
That's seems a lot of redundancy.  I've seen a number of form events that
look like they would, but are only work on pivot tables.  The form's OnClick
only happens if the record selector is clicked, and the detail section's
OnClick doesn't seem to do anything.  Isn't there a really simple way to do
this?

- Max
ruralguy - 22 May 2007 20:21 GMT
It sounds like you may have things reversed but maybe this link will help.
http://allenbrowne.com/ser-28.html

>Hi All,
>        This is probably a dead simple thing, but I'm stuck on it.
[quoted text clipped - 15 lines]
>
>- Max

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Max Moor - 22 May 2007 21:55 GMT
> http://allenbrowne.com/ser-28.html

Hi Allen,
       My thing is similar to the examples on the website, but not quite.  I
have a combobox in the form header, from which a supplier can be selected.  
One subform (continious forms) then shows the products acquired from that
supplier.  I use a subform there so the main product info can be edited right
there.  The rest of the form shows more detailed information for which ever
product is selected in the product subform.  The SQL for the mainform uses a
value in the subform's currently selected record as a criteria.  So I have
is:

       cboSupplier -> fsubProduct -> frmMain (product details)

       I guess it looks a little screwy, but it sure works well.  The downside
is having OnClick event code for every control on the subform, just to detect  
that there has been a record selection change.

       What I'm trying to figure out if there is a simpler mechanism for
detecting the selection change in the subform, so I can requery the main
form.  The AfterUpdate for the subform is close, but only happens if data in
a control changes.

- Max
ruralguy - 22 May 2007 23:36 GMT
The SubForm Current event fires every time there is a record selection change.

>> http://allenbrowne.com/ser-28.html
>
[quoted text clipped - 20 lines]
>
>- Max

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.