I have created a form with a combo box that allow user to select a
certain employee name and when user select the name the report based on
query is generated.
I want to include an extra option in the combo box so that if user
wants to generate a report for all the employees.
Thanks
Pervaiz Ahmad
Red - 04 Jan 2006 21:37 GMT
Ahhh... time to blow off coding, and help some people! :D
Anyhow, you can program a command button to mimic selecting all the
employees, and create a report off of that. I honestly am not that
great at programming, but, it's really not that hard....
i.e.
1 Employee
cmdButton1_click()
Dim employeeID as integer
employeeID = combo1.value
'do stuff with the value here....
end sub
All emlpoyees
cmbButtons2_click()
dim X as integer, EmployeeID as integer
for X = 0 to combo1.listcount - 1
employeeID = combo1.ListIndex(X)
'do stuff with the value here....
next X
end sub
~Red
pervaiz.ahmad@gmail.com - 05 Jan 2006 04:18 GMT
thanks it is a good idea but instead of that why not create another
query or copy the same one without any criteria and execute it from
that button.
Kurt - 05 Jan 2006 12:34 GMT
> I have created a form with a combo box that allow user to select a
> certain employee name and when user select the name the report based on
[quoted text clipped - 3 lines]
> Thanks
> Pervaiz Ahmad
You can edit the underlying query of the combo box to include an
"(All)" option. Selecting this will select all records. Lots of
tutorials available on this. The first one seems most relevant to your
situation:
http://www.accessdatabasetips.com/adding-an-all-choice-to-a-combobox.html
http://www.mvps.org/access/forms/frm0043.htm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnima01/html/im
a0143.asp
Kurt