Grabbing Info from a TextBox on a Report

B

Brad

We want to add a TextBox to a report that is viewed online. The data
collected in this TextBox will be used to adjust the report filter.

We want to allow our users to enter as much of a Customer Name as they want
after they see the report with all Customers shown. We then want to use
this info to change the Report Filter. We have never tried this before.
For some reason, we cannot see the data in the TextBox in our VBA code. It
appears that Access Reports behave differently than Access Forms as far as
grabbing data from TextBoxes. We must be missing something. Does anyone
have a sample of how to do this or advice on what to look out for.

Thanks,
Brad
 
A

Al Campagna

Brad,
Reports don't have editable text, or events, as forms do.
Any options you need for a report (show all, show some, show one) must
be done when the query runs.

A common solution (there are more than one method to do this) is to have
a text control on an open form... from which the
report is run. (ex. names - text control = txtCriteria and form =
frmCiteria)

Given the following crireia in the report query...
CustomerName
Like "*" & Forms!frmCriteria!txtCriteria & "*"

If Criteria = null, all CustomerNames will be returned.
If Criteria = "Man" then CustomerNames like Manning, Manchester, etc...
will be returned
The narrower the criteria, the narrower the results.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
B

Brad

Al,

Thanks for your help.

I didn't know that Access Reports can not have editable text fields. This
explains what we were running into.

We will resort to using a Form to collect the info from the user.

Thanks again,

Brad
 

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