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 / May 2006

Tip: Looking for answers? Try searching our database.

Help With Requery of a control on a Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Del - 13 Feb 2004 18:38 GMT
Hello,

I have an Access 2000 database that I want to use to keep track of the
part numbers being used for new parts. The main form has all the data
regarding the part (Setup Date, Part Nbr Assigned, Purchased or
Manufactured, Supplier, etc). I also have a subform (Call
frmNextAvailablePartNbrSubfrm)on the main page that is linked via a
query that pulls the next available part number from a table that has
a list of all the available part number our department is allowed to
use. On the "On Exit" event of last field of the main form I run some
code that runs a Delete Query. The delete query removes the Part
Number that was just asigned from the "tblAvailablePartNbr" table. I
am also attempting to then requery the Subform so it will display the
next available part number from the "tblAvailablePartNbr" table.

When I exit the last control on the main page the delete query works
and the part number used is deleted from the table. The subform then
show #Deleted
And I get an error when the requery code is run.
The error reads;

Run-Time Error '2450'
Microsoft Access can't find the form "frmNextAvailablePartNbrSubfrm"
referred to in a macro expression or visual basic code.

I have tried using   Me!SubformControlName.Requery  and
Forms!SubformName!SubformControlName.Requery

Thank you for any assistance or ideas.

Del
Ragnar Midtskogen - 13 Feb 2004 20:11 GMT
When you refer to a subform you need to following the subform name with the
property Form, since this is not the default property

To requery the subform you would use Me!SubFormName.Form.Requery

To refer to a control on a subform  Me!SubFormName.Form!ControlName

Ragnar
Gigio - 25 May 2006 15:32 GMT
Clear and straight to the point, this is a very, very useful tip.

>When you refer to a subform you need to following the subform name with the
>property Form, since this is not the default property
[quoted text clipped - 4 lines]
>
>Ragnar
 
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.