Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Using combo box element as search criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pervaiz.ahmad@gmail.com - 04 Jan 2006 11:25 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.