Hi all, I want to make a report based on a variable SQL query but I can't for the life of me remember how to do that 
Here's the thing, the database is a simple address table with a bunch of addresses in it which have route numbers. Now what I want on my form is a button that when clicked pops up a box where I can enter a route number and then all records with the corresponding route number are selected and sent to my report. Shouldn't be too hard but I just don't remember how to do this.
Quickly in steps:
- User is done doing stuff on the form
- User hits print route button
- A box pops up asking which route number
- User enters route number and hits ok button
- Query does it's stuff and presto route is presented in the report ready to print.
How do I make this happen? Last time I've used MS Access I was still in school and haven't worked databases since then.
BobbaFet ![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
Here's the thing, the database is a simple address table with a bunch of addresses in it which have route numbers. Now what I want on my form is a button that when clicked pops up a box where I can enter a route number and then all records with the corresponding route number are selected and sent to my report. Shouldn't be too hard but I just don't remember how to do this.
Quickly in steps:
- User is done doing stuff on the form
- User hits print route button
- A box pops up asking which route number
- User enters route number and hits ok button
- Query does it's stuff and presto route is presented in the report ready to print.
How do I make this happen? Last time I've used MS Access I was still in school and haven't worked databases since then.
![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
Code:
if not Programming = 'Severe Migraine' then
ShowMessage('Eureka!');