Object Required Error

TimTDP

Registered User.
Local time
Today, 21:32
Joined
Oct 24, 2008
Messages
213
I need to requery numerous fields on a subform of a subform!
I use this:
[Forms]![frmCustomer]![frmCustomerQuotationManufactureDispatch]![frmCustomerQuotation].Form!lstQuotationDates.Requery

Because this is longwinded, I was hoping to declare the forms like this:
Dim ctlName

ctlName = "[Forms]![frmCustomer]![frmCustomerQuotationManufactureDispatch]![frmCustomerQuotation].Form"

and requery the fields using:
ctlName!lstQuotationDates.Requery

Access doesn't like this! I get an object required error.

What am I doing wrong?

Thanks
 
Code:
Dim MyForm as Form
Set MyForm = [Forms]![frmCustomer]![frmCustomerQuotationManufactureDispatch].Form![frmCustomerQuotation].Form
 

Users who are viewing this thread

Back
Top Bottom