Discussion Locked

Access 97

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to populate a series of form controls using a Query. However, when I run the form i get the #Name? Error message. I belive this to be as a result ofhte control being unable to see the query. The query has been tested and works perfectly.the path I am using to access the field in the form is =[GetCompanyDetails]![CustomerCompanyName] where GetComapnyDetails is the name of the query and CustomerCompanyName is the field i want to place in the form control! Any advice would be gratek appreiciated!!!

Regards

Stephen

3 replies

by sl-campbell

You are trying to assign the controlsource to something that doesn't exist. You need to set the Form's datasource to the query and then assign the control's controlsource to the field that you want - this is then the bound mode. Set the form's datasource to GetComapnyDetails and the control's(textbox?) controlsource to CustomerCompanyName.

If you want the controls to have unbound mode then you need to create a recordset object in code, say on the form load event, and then assign each control's value property on the form to a field in the current record each time the recordset is repositioned.

This discussion is closed to new replies.