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 / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

requery a combo box on a subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gen - 24 May 2007 21:07 GMT
hello,

I have a form, Purchase Orders, containing the subform Purchase oRder
Subform. I want to limit the products on the subform based on the supplier
selected on the main form. I already wrote the select code into the row
source of the products, and it works (kinda), but I can't requery after
updating the suppliers. I wrote a requery macro and put it in the "After
Update" event using the control name:

Forms![Purchase Order]![Purchase Order Subform].Form![ProductID]

and a variety of these combinations, but they all give the same results: an
error saying there is no such feild in the current record.  The sbuform is
linked ot the main form by a PO number. I don't know very much VB.

Please help!
Scott - 24 May 2007 21:18 GMT
use VBA find the afterupdate of the supplier field
Private Sub supplierfield_AfterUpdate()
Me.PurchaseOrderSubform.requery

hope this helps

> hello,
>
[quoted text clipped - 12 lines]
>
> Please help!
KARL DEWEY - 24 May 2007 21:18 GMT
Try this ----
[Forms]![Purchase Order]![Purchase Order Subform]![ProductID]

Signature

KARL DEWEY
Build a little - Test a little

> hello,
>
[quoted text clipped - 12 lines]
>
> Please help!
Gen - 25 May 2007 14:11 GMT
Thank you both for the quick response, unfortunatly neither suggestion
worked. When I use the VBA code, I get a message saying there is syntax error
and its highlighted the phrase

Private Sub SupplierID_AfterUpdate()

Which doesn't make a lot of sense to me since access wrote it! When I use
the different control name suggested I still get the error "There is no Field
named '[Forms]![Purchase Order]![Purchase Order Subform]![ProductID]' in the
current record.

Any other suggestions?

> Try this ----
> [Forms]![Purchase Order]![Purchase Order Subform]![ProductID]
[quoted text clipped - 15 lines]
> >
> > Please help!
Gen - 31 May 2007 20:49 GMT
OK I've got this finally working,

I had to use VBA to set up the requery not just on the after update property
but also on current. I used :

Me.[SubformName].Form.FieldName.Requery

And I also used the WHERE clause in the ProductID field to limit to the
SupplierID in the main form. Great!

PROBLEM:  The subform will only list items that have previously been
ordered. Therefore, if I add new items to the Items Table (separate from
purchase orders table) I cannot see them on the form. BUT I can add them
using the table (obviously not ideal).  

> Thank you both for the quick response, unfortunatly neither suggestion
> worked. When I use the VBA code, I get a message saying there is syntax error
[quoted text clipped - 28 lines]
> > >
> > > Please help!
 
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.