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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting value of a main form control from a subform

Status
Not open for further replies.

ddub

MIS
Jul 9, 2002
17
US
Hi,

Could someone tell me how I can set the value of a control in my main form from an AfterUpdate event in my subform? My simplified code in the subform event is as follows:

Code:
Dim strControl as String

strControl="Something"

forms!frmMain!txtControl=strControl
<---Here's where it errors out

I get a run-time error 2448 &quot;You can't assign a value to this object.&quot; frmMain is the main form and txtControl is the control in the main form that I want to assign the strControl value to. Any ideas of how to make this work?

Thanks,
ddub
 
My bad. What I coded should have worked and indeed did after I updated my stored procedure recordsource to include the txtControl field's control source. Oops.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top