Can a control bind to a differnt source than the form?

scottydel

Registered User.
Local time
, 21:49
Joined
Apr 18, 2007
Messages
35
Hello,

I have a subform that is bound to a query. I have some textbox controls that are bound to fields in that query. Everything is working fine. I also have another control, on the same subform, that I would like to bind to a different query altogether independent of the query that's bound to the subform.

Doesn't seem possible using the Properties available for the control in question. All I see available is the Control Source Property, and the only fields available are fields from the original query that's bound to the subform. I tried building an expression in the Control Source Property using the new query I would like to bind to, but I am getting #Name? error in the control in question.

Again, the subform is bound to a query, and all of the controls on the subform are working fine, except for the one that I would like to bind to a different query altogether.

Should I just create a new subform for this one control and the new query?

Any ideas?

Thanks,

Scott
 
No you can't directly bind a control to something other than the field selected as the recordsource of the form. However, you can use either a query to insert, update, append the data or you can use code via ADO or DAO to do it.
 
Thanks, I used DAO and its' working.

What do you mean I can insert/update/append the data. Do you mean add additional fields to my query result so I have new fields that the form is bound to?
 
No, you would have a separate query that has the text box set as its criteria and then using code in the form's AfterUpdate event you could call it like

CurrentDb.Execute "YourQueryNameHere"
 

Users who are viewing this thread

Back
Top Bottom