Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create an auto report with a user defined field?

Status
Not open for further replies.

kp1279

Programmer
Jan 21, 2005
43
GB
I have a database set up, and I have created a combined report that will print certain fields from a number of different records. This works OK, however what I am wanting to try and achieve is this:-

I want the report to compile as it does at the moment, I then want this report to ask the user for a location or value for a field, This then should be included on the report before it goes off on its merry way and prints.

Any help is appreciated.
 
You can add a text box with a control source of:
=[Enter a value you want to display]

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I think I have not explained the problem well.

I have a table which feeds a form, when I navigate the records, I create a tag for the ones I want.

These tags are checked via a query which feeds a combination report.

The combination report works fine, however I want the computer to ask for an input when I click on the Print Combined button.

The users of the system will not be allowed to alter the layout of the reports, cause they would mess them up. So it will have to be a request field for the user to write in their comment which will then appear on the combined report.
 
Duane's suggestion will work. You have to place a textbox on the report as Duane suggested. Users will not alter the report. They will be asked to enter the comment by an input box.

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
I must be doing something wrong then as it doesn't seem to work.

I opened the report in design mode

Added a text box

Build in an control source of ' =[Enter your destination]

and save the report.

When I then click on the print button, which runs the Macro, the form prints without asking the question, and in the text box is: - ' #Name? '

I must be doing something wrong, but not sure what.
 
This works for me.
Code:
=[Enter your destination]
Or try
Code:
=([Enter your destination])
Both works perfect

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Try set these properties of the text box:
Name: txtAskUser
Control Source: =[Enter your destination]

I have never had an issue with doing it this way. However, I would prefer to have a user enter a value into a text box on a form and then use a control source of:
Control Source: =Forms!frmYourForm!txtYourTextBox


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
It must be me, but let me tell you what I did.

I went into the design view of the form.

Added a text box, which shows as 'unbound', I then went into the properties, and edited the control source to read the above.

In the design view the text box then changed from 'unbound' to '=[Enter your destination]'

When I then either run the macro or open the report as normal, it doesn't ask for a destination, it just shows as before ' #Name? '

Please tell me I am going mad.

This page is a set page, it is a header page, with some default text like current date and time etc, but I want it to ask the user to define this field, the macro then runs the the query which launches pages 2 onwards.

Is there any other way?? perhapse I could try that if I still get no joy with this.
 
I assume your "design view of the form" was just a typo. You have never provided us with the name of the text box.

Another method is to add a column to your report's record source query:

NewField: [Enter your destination]

When you run the query, you will be prompted for the NewField value.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top