I have created a computer database with Access 2003 to track computers and their repairs. I have a report that works like this; from a form menu the user selects computers by model#, another form opens for the user to type the model number they want from the report, the query runs and they have the report. What happens is if the user does not enter the entire model# or a partial the report is blank. Is there a way to either a) have the model# entered with wildcards (*) or b) a combo box that will extract the already entered data and give users a chance to just select rather than just remember the entire exact model#?
from a form menu the user selects computers by model#, another form opens for the user to type the model number they want from the report,
Are these different model numbers? Are they coming from the same place?
You can solve your problem in two ways:
On the second form that opens for them to type in the model number add a list box or combo box that is populated with the model numbers. Let the user choose from the list and use that value for your query
or, if you want to include wildcards let the user type in the value and change your query.
Instead of something like this: select * from tablename where modelNum = "abc"
use something like this: select * from tablename where modelNum like "*abc*"
(or like "abc*" if you only want to search form model numbers starting with abc)
We have about 200 computers and when new computers are purchased they can come in batches of 10-20. Over the years the purchases come from what ever is best on the market at the time, so needless to say there are a wide verity of model#s. I did not bother with the combo box since that would require me to go in and change the table data every time a purchase is made. Also, add to the mix that I am not importing any previous recorded data because it basically does not exist, so at this point I cant say for sure that I have all the model#s recorded.
Thanks for you input, it put me on the right track, but I finally managed to get the result I need. I may not have explained it the right way, but here is my solution:
Select the button from my menu form “Report by Model#”, it goes to a query that will gather the model numbers in the table (query properties ‘Unique Values’ set to Yes (default is No)), a form opens for the user to select the model desired from a combo box that has the already user entered numbers, sorts the numbers and only shows one instance of each model number. The report then previews with the desired data. I hope this is a good explanation.