Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the control source with VBA on certain fields in form

Status
Not open for further replies.

drazeni

Programmer
Apr 21, 2001
66
ZA
I Have a FE, BE database (Office XP - DB is in 2000 format).

Upon opening a form and selecting a certain account, I require that the control source of selected fields changes to a different source table.

In the form's query property, the relevant fields are selected, but I get the following error "run-time error 94: Invalid use of Null" after execution of the following code in an afterupdate event.

cust_company_name.ControlSource = preorder_cod_name

clients.name being the normal source and preorders.preorder_cod_name being the new source I'd like to direct the form to (different table).

Any suggestions would be appreciated.

Thanks. "All is not as it seems"
 
I think you have to use quotes

cust_company_name.ControlSource = "preorder_cod_name"


 
OOOhhh... silly me!

In my haste looking through the help, I missed that one.

(embarrassed)

Thank you, it worked. "All is not as it seems"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top