I have a query with a column for Employees. I set up a criteria command that prompts the user to enter an employee ID number (The number is the Primary key ID number linked to each Employee in the "Employee" table). So as of right now, the user clicks on the report button which displays a prompt window which asks the user to enter in the employee ID number. EX. The user will enter "1" to see all Bill's hours worked, "2" to see Sarah's hours worked, and so on.
I want to set up a form that will contain a listbox that will allow the user to select an employee's name instead of having to know what number corresponds to each employee. So if I select "Bill" in the list box and click "OK" (this command button will be linked to the report which is based on the query), a number "1" will automatically be placed in the Criteria, and the report open just displaying Bill's hours. I want to do this to eliminate the prompt window so all the user has to do is select the name and the corresponding employee ID number is automatically placed in the criteria. Is there any command code I can place in the criteria command box to do this? I've tried [Forms]![FormName]![FieldName], but this does not work. Thanks in advance.
I want to set up a form that will contain a listbox that will allow the user to select an employee's name instead of having to know what number corresponds to each employee. So if I select "Bill" in the list box and click "OK" (this command button will be linked to the report which is based on the query), a number "1" will automatically be placed in the Criteria, and the report open just displaying Bill's hours. I want to do this to eliminate the prompt window so all the user has to do is select the name and the corresponding employee ID number is automatically placed in the criteria. Is there any command code I can place in the criteria command box to do this? I've tried [Forms]![FormName]![FieldName], but this does not work. Thanks in advance.