So I spent nearly a whole day chasing a seemingly simple solution to a Microsoft Access problem, and I’ve finally found the officially sanctioned solution. Here it is.
Now, the non-geeks can go read the posts below, or wait for the next one. This post isn’t for you.
Have a quick read, my fellow software developers, especially the part about creating a form to supply parameters to a query. You’ll note the following steps:
- Create a new form and add the controls needed for entering the parameters.
- Modify your query so that it obtains its parameters from the controls on the form.
- Add an OK button to the form that runs the query and then closes the form.
- Add a Cancel button that closes the form without running the query.
Yes, you’re modifying the query so that it obtains its parameters from the controls on the form. This is a test to see how much attention you were paying in your software design classes (or indeed if you had any).
If you fail to see the problem, then clearly… you’re an Access developer (dare I say Microsoft Developer?). I now have nothing but disdain for you, and all Access MVPs. I’d assume someone would stand up and point out to Microsoft how bad it really is, but clearly you never realised.
If on the other hand, you’re now looking on in sheer terror, welcome to my frustration! What manner of infernal coupling is this?! Could it be that there’s no method to pass a variable?! Yes, dear friend, Access doesn’t let you pass a parameter to a query. Oh no, you must either bind a database element (the query) to a GUI element (the field on the form), or rely on the user to put in the value through a series of generic input dialog boxes.
Reuse? Bah!
Access is not so much a database system as an evil, evil lie.
</rant>










