I’d appreciate comments/help on this problem.
I’ve lately moved to Access 2010 after using and hobby programming Paradox for 10-15 years.
I’m trying to create a query which outputs selected records from an Access Table after it receives user input via a second form. Here are some more details:
The Access table is named “RBProjects” and has an automatic key field (per Access) called “ReferenceID”, and several alphanumeric fields named “Category”, “Subcategory” and “Project”.
I’m interested in running a query by searching of RBProjects by presenting a second search form bound to RBProjects called “FrmSearchProjects” which includes three unbound text boxes, named “Category”, “Subcategory” and “Project”. This second search form is bound to RBProjects.
I’ve generated a new query, based on RBProjects which includes all of the fields of RBProjects. In the query, for the “Project” column in the Criteria: row I have the following:
=[Forms]![RBProject]![Project]
There are no other statements in the Criteria: row for any other field. I then used the wizard to prepare a button to run the query, so that clicking on it should pass the value in the unbound “Project” field of FrmSearchReports to the query, and display the records of RBProjects having the matching value of “Project”.
Here’s where I have problems….
I can enter a known value (known from ‘Projects’ from the table RBProjects) into the unbound field “Projects” on the FrmSearchReports, and click the button to run the query…. however, this does not work, and the results of the query show no change.
However, with the same value in the unbound “Projects” field of FrmSearchReports and that form open, I go to the query, switch to design view, and click “Run” (red exclamation mark) and the query now runs properly, and the records from RBProjects having the same value as in the unbound “Projects” field of FrmSearchReports to the query are now displayed.
A: Is there something wrong with my query ?
B: Any ideas why the value of the unbound field doesn’t work in the query when run from the button, but does work when run directly from the (design view) of the query ?
C: Any other insights/suggestions would be appreciated……..
I’ve lately moved to Access 2010 after using and hobby programming Paradox for 10-15 years.
I’m trying to create a query which outputs selected records from an Access Table after it receives user input via a second form. Here are some more details:
The Access table is named “RBProjects” and has an automatic key field (per Access) called “ReferenceID”, and several alphanumeric fields named “Category”, “Subcategory” and “Project”.
I’m interested in running a query by searching of RBProjects by presenting a second search form bound to RBProjects called “FrmSearchProjects” which includes three unbound text boxes, named “Category”, “Subcategory” and “Project”. This second search form is bound to RBProjects.
I’ve generated a new query, based on RBProjects which includes all of the fields of RBProjects. In the query, for the “Project” column in the Criteria: row I have the following:
=[Forms]![RBProject]![Project]
There are no other statements in the Criteria: row for any other field. I then used the wizard to prepare a button to run the query, so that clicking on it should pass the value in the unbound “Project” field of FrmSearchReports to the query, and display the records of RBProjects having the matching value of “Project”.
Here’s where I have problems….
I can enter a known value (known from ‘Projects’ from the table RBProjects) into the unbound field “Projects” on the FrmSearchReports, and click the button to run the query…. however, this does not work, and the results of the query show no change.
However, with the same value in the unbound “Projects” field of FrmSearchReports and that form open, I go to the query, switch to design view, and click “Run” (red exclamation mark) and the query now runs properly, and the records from RBProjects having the same value as in the unbound “Projects” field of FrmSearchReports to the query are now displayed.
A: Is there something wrong with my query ?
B: Any ideas why the value of the unbound field doesn’t work in the query when run from the button, but does work when run directly from the (design view) of the query ?
C: Any other insights/suggestions would be appreciated……..
Last edited: