George10988
Registered User.
- Local time
- Today, 15:26
- Joined
- Apr 23, 2011
- Messages
- 41
Hello everyone,
I am fairly new to Access and have been put on a project at my job to create a database for a local police station. I have good knowledge in C#; however, not much in VBA or SQL. I am having a problem here that I hope someone can help me with and with as much detail as possible (if possible). I created a form to be a main search form for the whole database. I want the officers to be able to select from five combo boxes on that form. Each combo box is linked to a common query that has all the fields (columns?) from every single table that I have. I basically want them to be able to select their own search parameter from the drop down list that is based off a field. I then want them to be able to type into the text box associated with it to get more specific results. So for example:
First Drop Down = FirstName, LastName, GangAffiliation, StreetName, etc.
Say for example they choose "FirstName" obviously I want them to be able to type in the name they want to search for in the text box and get the appropriate results in query view.
I want them to be able to choose any combinations they desire.
I am able to link textboxes themselves to a query by placing the following code under the criteria area for a query:
Like (IIf(IsNull([Forms]![frmDatabaseSearch]![txtSearchByFirstName]),"*",[Forms]![frmDatabaseSearch]![txtSearchByFirstName]))
however I realized that offering the ability for officers to choose which fields they want to search would be better for this type of database. Any help would be appreciated.
I am fairly new to Access and have been put on a project at my job to create a database for a local police station. I have good knowledge in C#; however, not much in VBA or SQL. I am having a problem here that I hope someone can help me with and with as much detail as possible (if possible). I created a form to be a main search form for the whole database. I want the officers to be able to select from five combo boxes on that form. Each combo box is linked to a common query that has all the fields (columns?) from every single table that I have. I basically want them to be able to select their own search parameter from the drop down list that is based off a field. I then want them to be able to type into the text box associated with it to get more specific results. So for example:
First Drop Down = FirstName, LastName, GangAffiliation, StreetName, etc.
Say for example they choose "FirstName" obviously I want them to be able to type in the name they want to search for in the text box and get the appropriate results in query view.
I want them to be able to choose any combinations they desire.
I am able to link textboxes themselves to a query by placing the following code under the criteria area for a query:
Like (IIf(IsNull([Forms]![frmDatabaseSearch]![txtSearchByFirstName]),"*",[Forms]![frmDatabaseSearch]![txtSearchByFirstName]))
however I realized that offering the ability for officers to choose which fields they want to search would be better for this type of database. Any help would be appreciated.