If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Grabbing Info from a TextBox on a Report
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 |
#2
|
|||
|
|||
Grabbing Info from a TextBox on a Report
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." "Brad" wrote in message ... 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 |
#3
|
|||
|
|||
Grabbing Info from a TextBox on a Report
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 "Al Campagna" wrote: 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." "Brad" wrote in message ... 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 . |
Thread Tools | |
Display Modes | |
|
|