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 2005

Tip: Looking for answers? Try searching our database.

sub form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen53 - 02 May 2005 23:39 GMT
Hi,

I have a main form containing a combo box.  Based on the combo box value, a
sub form displays data.  Everything is fine when I open the form or change
records.  If I change the value of my combo box, I need the sub form to
display the information based on the new value of the combo box.  How do I do
this?  I know it would be after update but what would the code be?  Do I
reference the whole sub form as a requery or just one of the boxes?  I need
the whole sub form to display the new data.

Thanks,
Paul Overway - 02 May 2005 23:53 GMT
Assuming the value in the combo matches a field within the subform
recordsource, you could just set the Link Master/Child property for the
subform.   The Master would be the name of your combo and the Child would be
the name of the field within the subform recordsource.

If the above is not an option, you need to programmatically set the
recordsource for the subform from the AfterUpdate event for the combobox,
i.e.,

Me.SomeSubForm.Form.RecordSource = "SELECT * FROM SomeTable WHERE SomeField
= '" & Me.SomeCombobox & "'"

When you assign a new recordsource, the requery is automatic.

Signature

Paul Overway
Logico Solutions
http://www.logico-solutions.com

> Hi,
>
[quoted text clipped - 10 lines]
>
> Thanks,
Al Camp - 02 May 2005 23:56 GMT
Karen,
  On AfterUpdate of the combo...
       YourSubformName.Requery
should do it.
hth
Al Camp

> Hi,
>
[quoted text clipped - 10 lines]
>
> Thanks,
 
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.