By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,870 Members | 2,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,870 IT Pros & Developers. It's quick & easy.

Report asking for title (user input)

100+
P: 135
Hello

I was wondering if it is possible to create a textbox in a report which will ask the user (user input) for the "title" he wants for the report.

Thanks
Sep 17 '07 #1
Share this Question
Share on Google+
12 Replies


Scott Price
Expert 100+
P: 1,384
Hello

I was wondering if it is possible to create a textbox in a report which will ask the user (user input) for the "title" he wants for the report.

Thanks
You can pop up an Input box in the OnClick event of your Print/Preview command button asking for the user's title preference. See the inputbox help file in VBA for examples, instructions on how to use them.

Then from the input box, programatically open the report and pass it the value of the input box as title.

Regards,
Scott
Sep 17 '07 #2

100+
P: 135
You can pop up an Input box in the OnClick event of your Print/Preview command button asking for the user's title preference. See the inputbox help file in VBA for examples, instructions on how to use them.

Then from the input box, programatically open the report and pass it the value of the input box as title.

Regards,
Scott
Thanks for the reply Scott, i already read through help and the example there i was just wondering if there was a "simpler" way to do it.

I once left an unbounded textbox and i remember it asked me for the value and actually i think i wrote some test "questions" for this userinput i just cant remember whats the property where you can write this??? I already tried the control name, source, etc and nothing.

If this is not possible could you help me with some code just so that on opening the report it asks the user for the title???? Im really new on this.

Thanks again,
Gilberto
Sep 18 '07 #3

Scott Price
Expert 100+
P: 1,384
Thanks for the reply Scott, i already read through help and the example there i was just wondering if there was a "simpler" way to do it.

I once left an unbounded textbox and i remember it asked me for the value and actually i think i wrote some test "questions" for this userinput i just cant remember whats the property where you can write this??? I already tried the control name, source, etc and nothing.

If this is not possible could you help me with some code just so that on opening the report it asks the user for the title???? Im really new on this.

Thanks again,
Gilberto
No code needed probably. Your report should be bound to a query. Create an extra field in the query called Title: As WHERE criteria point it to a text box somewhere that doesn't exist. For example, Forms!FormNonExist!TitleTextBox.

Then whenever you open the report/query it will prompt for that parameter...

Regards,
Scott
Sep 18 '07 #4

100+
P: 135
No code needed probably. Your report should be bound to a query. Create an extra field in the query called Title: As WHERE criteria point it to a text box somewhere that doesn't exist. For example, Forms!FormNonExist!TitleTextBox.

Then whenever you open the report/query it will prompt for that parameter...

Regards,
Scott
Thanks Scott i almost got it, i just dont understand where and what exactly to write after "WHERE". If i write the "Forms!FormNonExist!TitleTextBox" in the table property for the title in the query it tells me that that table doesnt exist that i have to select from the list.

Could you be a bit more specific i really am new here.
Thanks
Sep 18 '07 #5

Scott Price
Expert 100+
P: 1,384
Thanks Scott i almost got it, i just dont understand where and what exactly to write after "WHERE". If i write the "Forms!FormNonExist!TitleTextBox" in the table property for the title in the query it tells me that that table doesnt exist that i have to select from the list.

Could you be a bit more specific i really am new here.
Thanks
No problem! Go into the query design view grid. In an empty Field grid write this:
Expand|Select|Wrap|Line Numbers
  1. Title: [MyTitle]
Just that, nothing more! (you can adjust the language to suit your needs, but the format needs to stay the same and
you actually don't need the forms!... part..., now that I think about it more).

In your report, you will have a control, such as text box that you will bind to this new field in your query. Whenever the query is run (by opening the report, for example) it will prompt the user for this parameter, and then whatever they enter will show up in the query field, as well as whatever control is bound to that field.

Regards,
Scott
Sep 18 '07 #6

100+
P: 135
No problem! Go into the query design view grid. In an empty Field grid write this:
Expand|Select|Wrap|Line Numbers
  1. Title: [MyTitle]
Just that, nothing more! (you can adjust the language to suit your needs, but the format needs to stay the same and
you actually don't need the forms!... part..., now that I think about it more).

In your report, you will have a control, such as text box that you will bind to this new field in your query. Whenever the query is run (by opening the report, for example) it will prompt the user for this parameter, and then whatever they enter will show up in the query field, as well as whatever control is bound to that field.

Regards,
Scott
Hello again Scott,

I have created the query. As you said in the field i only wrote: "Title: [Type a Title for the Report]", with no table or anything else. I saved the query as Title. So far if i run the query it does work...it asks me to "type a tutle for the report". Now my problem is "binding" it with the report. If i select the query as the REPORTS RECORD SOURCE: "SELECT Title.Title FROM Title;" and run the report i get the error: "query input must contain at least one table or query". And if i select the query as the TEXTBOX (title) control source: "=title!Title" i get a "#ERROR" as the textbox display.

I dont get if theres another way to "bind" the query and the report, as you tell me.

Sorry again, any more ideas???
Gilberto
Sep 19 '07 #7

ADezii
Expert 5K+
P: 8,637
Hello

I was wondering if it is possible to create a textbox in a report which will ask the user (user input) for the "title" he wants for the report.

Thanks
This is a lot simpler than you think, Gilberto.
  1. Create a Text Box in the Report Header Section.
  2. Under Properties ==> Data Tab, for the Text Box, place the following line of code:
    Expand|Select|Wrap|Line Numbers
    1. =[Enter Report Title]
  3. When the Report opens, the User will see the Enter Report Title prompt, and whatever value he types in, will appear within that Text Box in the Report Header Section.
Sep 19 '07 #8

Scott Price
Expert 100+
P: 1,384
Go with ADezii's solution, because it is simpler.

However, to explain a little more what I was talking about:

Your report has to be based on a query already. The Title: [NewTitle] just goes into a new field in the existing query, not into a new query. Then it is available for use to bind to any control on the report.

Regards,
Scott
Sep 19 '07 #9

100+
P: 135
This is a lot simpler than you think, Gilberto.
  1. Create a Text Box in the Report Header Section.
  2. Under Properties ==> Data Tab, for the Text Box, place the following line of code:
    Expand|Select|Wrap|Line Numbers
    1. =[Enter Report Title]
  3. When the Report opens, the User will see the Enter Report Title prompt, and whatever value he types in, will appear within that Text Box in the Report Header Section.
Indeed i was complicating things....however...i still CANT get it to work, and the worst thing is that ONCE, cant remember how...i managed to do it.

So i created the textbox named title. In the DATA tab i cant only find:
Control Source, input mask, running sum and smart tags. In CONTROL SOURCE im entering "=[Enter Report Title]". And all i get is the textbox displaying "#Name?".

Ive tied this on another report, a new report, etc etc and nothing...

Thanks
Sep 19 '07 #10

ADezii
Expert 5K+
P: 8,637
Indeed i was complicating things....however...i still CANT get it to work, and the worst thing is that ONCE, cant remember how...i managed to do it.

So i created the textbox named title. In the DATA tab i cant only find:
Control Source, input mask, running sum and smart tags. In CONTROL SOURCE im entering "=[Enter Report Title]". And all i get is the textbox displaying "#Name?".

Ive tied this on another report, a new report, etc etc and nothing...

Thanks
Do NOT use Quotation Marks:
Expand|Select|Wrap|Line Numbers
  1. =[Enter Report Title]
Sep 19 '07 #11

100+
P: 135
Do NOT use Quotation Marks:
Expand|Select|Wrap|Line Numbers
  1. =[Enter Report Title]
Sorry, indeed im NOT using " ", it was just to explain what im exactly writing.

HELP...
Sep 20 '07 #12

100+
P: 135
Sorry, indeed im NOT using " ", it was just to explain what im exactly writing.

HELP...
Thanks for your help guys. The problem, as Scott mentioned, it was that my report WASNT based on ANY queries or tables. I just added a query and VOILA!

Thanks for your time and effort.
Gilberto
Sep 20 '07 #13

Post your reply

Sign in to post your reply or Sign up for a free account.