user input

B

Brendan Mather

I'd like to be able to input a value (ex Victoria, in the city field) and a
report would pop up with all the people who have victoria somewhere in there
city field, whethere it's Victoriaville, or City of Victoria, or just
victoria. does anyone know how to do this?

thanks,
brendan
 
A

Albert D. Kallal

Build a un-bound form. That is a form that is NOT attached to a table.

(you thus can turn off all the stuff like navigation buttons, record
selections. Just turn all that junk off, since our goal is a nice clean form
with a nice prompt for the City search.

You then place a button on your form that launches the report, but RESTRICTS
it to your desired search. The following code behind a button would do
exactly as you ask:


dim strWhere as string

if isnull(me.txtCity) = false then

strWhere = "City like '*" & me.txtCity & "*'"

endif

docmd.OpenReport "your report",acViewPreview,,strWhere

If you leave the city field blank, then "all" cities will show.

I use the above all the time. In fact, the above was used to make the
following report prompt screens. I hope the screen shots give you some
ideas.

http://www.attcanada.net/~kallal.msn/ridesrpt/ridesrpt.html
 
S

Shane Andrews

Brendan,

You will need a simple query that searches for "*victoria* in the city
field, and have the report display the results.

Did that help?

Shane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top