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