I am having a blonde moment...I have a query that combines by year. I built a form on that query. Then I opened up the query and put the following into the criteria field:
When I re-open the form, it either pops up with enter the year in an access default dialogue box, or the form is blank..all the controls are gone.
Next the drop down for the employees isn't selectable. This is a look up column in the Registery table which goes from the employee table.
What I am trying to do is make a form, that allows an employee to be picked and a yearly report to be drawn up. It'd be nice if I could get the all option to work like it was described here. I get an SQL error when I do that method and a VBA error doing the other way. Thanks
1) You're trying to use the value of a control on the form as criteria in the query underlying the form. Since the form is not yet open and there is no value in the control, access asks the user for the value. Either of the following should take care of that problem.
Create a seperate form with cmbByYear and a button to open frmByYear and set the query criteria to cmbByYear on the new form.
Remove the criteria from the query and add code to the change event of cmbByYear (I'm asuming this is a combo box) to filter the data on the form.
2)Is the drop down bound to a field? Is the bound column of the drop down the same data type as the field? Can you update this field in the underlying query?
3)Please post the code that you are using for the all option>