<p>How would you create a database in Microsoft Access that is searchable only by certain fields and controlled by only a few (necessary) text boxes and check boxes on a form so it is easy to use - no difficult queries?</p>

<p>Example: 
You have several text boxes and several corresponding check boxes on a form, and when the check box next to the text box is checked, the text box is enabled and you can then search by what is entered into said text box</p>

<p>(Actually I already know this, just playing stackoverflow jeopardy, where I ask a question I know the answer just to increase the world's coding knowledge! answer coming in about 5 mins)</p>

[{'answer_id': 72643, 'author': 'BIBD', 'author_id': 685, 'author_profile': 'https://Stackoverflow.com/users/685', 'pm_score': 0, 'selected': False, 'text': '<p>For a question that vague, all that I can answer is open MS Access, and click the mouse a few times.</p>\n\n<p>On second thought:<br>\nUse the "WhereCondition" argument of the "OpenForm" method</p>\n'}, {'answer_id': 72660, 'author': 'ProfK', 'author_id': 8741, 'author_profile': 'https://Stackoverflow.com/users/8741', 'pm_score': 0, 'selected': False, 'text': '<p>At start-up, you need to show a form and disable other menus etc.  That way your user only ever sees your limited functionality and cannot directly open the tables etc.</p>\n\n<p>This book excerpt, <a href="http://msdn.microsoft.com/en-us/library/aa200349.aspx" rel="nofollow noreferrer">Real World Microsoft Access Database Protection and Security</a>, should be enlightening. </p>\n'}, {'answer_id': 72798, 'author': 'Philippe Grondier', 'author_id': 11436, 'author_profile': 'https://Stackoverflow.com/users/11436', 'pm_score': 1, 'selected': False, 'text': '<p>My own solution is to add a "filter" control in the header part of the form for each of the columns I want to be able to filter on (usually all ...). Each time such a "filter" control is updated, a procedure will run to update the active filter of the form, using the "BuildCriteria" function available in Access VBA.</p>\n\n<p>Thus, When I type "<code>*cable*</code>" in the "filter" at the top of the Purchase Order Description column, the "WHERE PODescription IS LIKE "<code>*cable*</code>" is automatically added to the MyForm.filter property ....</p>\n\n<p>Some would object that filtering record source made of multiple underlying tables can become very tricky. That\'s right. So the best solution is according to me to always (I mean it!) use a flat table or a view ("SELECT" query in Access) as a record source for a form. This will make your life a lot easier!</p>\n\n<p>Once you\'re convinced of this, you can even think of a small module that will automate the addition of "filter" controls and related procedures to your forms. You\'ll be on the right way for a real user-friendly client interface. </p>\n'}, {'answer_id': 74713, 'author': 'David-W-Fenton', 'author_id': 9787, 'author_profile': 'https://Stackoverflow.com/users/9787', 'pm_score': 1, 'selected': True, 'text': '<p>This is actually a pretty large topic, and fraught with all kinds of potential problems. Most intermediate to advanced books on Access will have some kind of section discussing "Query by Form," where you have an unbound form that allows the user to choose certain criteria, and that when executed, writes on-the-fly SQL to return the matching data.</p>\n\n<p>In anything but a flat, single-table data structure, this is not a trivial task because the FROM clause of the SQL is dependent on the tables queried in the WHERE clause.</p>\n\n<p>A few examples of some QBF forms from apps I\'ve created for clients:</p>\n\n<ol>\n<li><a href="http://dfenton.com/DFA/examples/Search.gif" rel="nofollow noreferrer">Querying 4 underlying tables</a></li>\n<li><a href="http://dfenton.com/DFA/examples/SearchSimple.gif" rel="nofollow noreferrer">Querying a flat single table</a></li>\n<li><a href="http://dfenton.com/DFA/examples/QBF/CFM.gif" rel="nofollow noreferrer">Querying 3 underlying tables</a></li>\n<li><a href="http://dfenton.com/DFA/examples/QBF/SA.gif" rel="nofollow noreferrer">Querying 6 underlying tables</a></li>\n<li><a href="http://dfenton.com/DFA/examples/QBF/WTS.gif" rel="nofollow noreferrer">Querying 2 underlying tables</a></li>\n</ol>\n\n<p>The first one is driven by a class module that has properties that reflect the criteria selected in this form, and that has methods that write the FROM and WHERE clauses. This makes it extremely easy to add other fields (as long as those fields don\'t come from tables other than the ones already included).</p>\n\n<p>The most complex part of the process is writing the FROM clause, as you have to have appropriate join types and include only the tables that are either in the SELECT clause or the WHERE clause. If you include anything else, you\'ll slow down your query a lot (especially if you have any outer joins).</p>\n\n<p>But this is a big subject, and there is no magic bullet solution -- instead, something like this has to be created for each particular application. It\'s also important that you test it thoroughly with users, since what is completely clear and understandable to you, the developer, is often pretty darned mystifying to end users.</p>\n\n<p>But that\'s a principle that doesn\'t just apply to QBF!</p>\n'}, {'answer_id': 156735, 'author': 'onedaywhen', 'author_id': 15354, 'author_profile': 'https://Stackoverflow.com/users/15354', 'pm_score': 0, 'selected': False, 'text': "<p>If the functionality is very limited and/or specialised then a SQL database is probably going to be overkill anyhow e.g. cache all combinations of the data locally, in memory even, and show one according to the checkboxes on the form. Previously you could have revoked permissions from the table and granted them only on VIEWs/PROCs that queried the data in the prescribed way, however security has been removed from MS Access 2007 so you can you now really stop users bypassing your simple app using, say, Excel and querying the data any way they like ...but then isn't that the point of an enterprise database? ;-)</p>\n"}]
['https://Stackoverflow.com/questions/72528', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']