Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Join Date
    Jul 2011
    Posts
    54

    Unanswered: Request textbox input on report output

    When I'm outputting my report, it asks a bunch of queries and displays data based on the input.

    Is it possible for a report to request input to a textbox, and then display your input in the textbox?

    If so how?

    Thank you.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    again I don't understand what you mean
    what are you trying to achieve
    take a step back from the problem and try to describe concisely in English what the problem is

    what I suspectg you want to do is to set up a series of parameters which control the report. if so yes its possible to pull (or push) values from a form into a report or report suite (so you use the same parameters for all reports in that suite).

    to push values append the parameters to the report when you call the report.. have alook at the properties for the docmd openreport
    ms access openreport - Google Search
    to pull values
    in the reports on open set up as required by pulling values from the form
    eg

    myreport.title = myform.controlname.value
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2011
    Posts
    54
    Quote Originally Posted by healdem View Post
    again I don't understand what you mean
    what are you trying to achieve
    take a step back from the problem and try to describe concisely in English what the problem is

    what I suspectg you want to do is to set up a series of parameters which control the report. if so yes its possible to pull (or push) values from a form into a report or report suite (so you use the same parameters for all reports in that suite).

    to push values append the parameters to the report when you call the report.. have alook at the properties for the docmd openreport
    ms access openreport - Google Search
    to pull values
    in the reports on open set up as required by pulling values from the form
    eg

    myreport.title = myform.controlname.value
    When I open my report, it asks for input, that is, input for the queries to produce results, and give put them into a report.

    Now.

    I want to have a textbox in it, which when I open my report, asks me for input, and DISPLAYS what I have inputted.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so you do want to use parameters to control the rows printed in a report

    again its not entirely clear what you want

    a report in access produces a report (which can be sent to the screen in preview mode or direct to a printer) so 'displays what I have inputted' doesn't make much sense in this context, unless you want to display what parmeters you have used to generate the report. if thats the case I'd suggest you capture the parameters in a form prior to launching the report and use those parameters for waht eevr purpose you want.

    as suggestred before you can set partameters using the openreport property of the docmd object
    you can pull those same values from a data capture form to stuff those parameters onto the report
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jul 2011
    Posts
    54
    nevermind I've done a workaround

  6. #6
    Join Date
    Jul 2011
    Posts
    54
    Quote Originally Posted by healdem View Post
    so you do want to use parameters to control the rows printed in a report

    again its not entirely clear what you want

    a report in access produces a report (which can be sent to the screen in preview mode or direct to a printer) so 'displays what I have inputted' doesn't make much sense in this context, unless you want to display what parmeters you have used to generate the report. if thats the case I'd suggest you capture the parameters in a form prior to launching the report and use those parameters for waht eevr purpose you want.

    as suggestred before you can set partameters using the openreport property of the docmd object
    you can pull those same values from a data capture form to stuff those parameters onto the report
    I really want to get this as the whole process would be a lot easier.

    Is there an expression in the textbox that requests input upon opening the report (whether in layout view or design view) and then displays it?

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can set a parameter in the query
    but apart from that I dont think so

    you may be able to use a modal form to collect such data when a report opens but I don't know as I tend to use a form to collect and validate parameters which are then stored on a form which controls report generation, when a user requests a report that menuform passes the appropriate values as part of the request, or more usually the report pulls the values from the menu form
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Something like this?
    Code:
    Private Sub Report_Open(Cancel As Integer)
    
        Me.Label_1.Caption = InputBox("Enter some value to be displayed:")
        
    End Sub
    Have a nice day!

  9. #9
    Join Date
    Jul 2011
    Posts
    54
    Quote Originally Posted by Sinndho View Post
    Something like this?
    Code:
    Private Sub Report_Open(Cancel As Integer)
    
        Me.Label_1.Caption = InputBox("Enter some value to be displayed:")
        
    End Sub
    This SHOULD work, where do I enter this code in Access 2007

  10. #10
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    In the class module of the report, the code is the event handler for the Open event:
    Code:
    Private Sub Report_Open(Cancel As Integer)
    Have a nice day!

  11. #11
    Join Date
    Jul 2011
    Posts
    54
    Here's my code, nothing happens:

    Private Sub Report_Open(Cancel As Integer)

    Me.Label28.Caption = InputBox("Enter the title for your report:")
    Me.Label22.Caption = InputBox("Enter the name of the project sponsor:")
    Me.Label23.Caption = InputBox("Enter the name of the program director:")
    Me.Label24.Caption = InputBox("Enter the name of the project manager:")

    End Sub

  12. #12
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Did you associate your code with the Open event of the form?
    Have a nice day!

  13. #13
    Join Date
    Jul 2011
    Posts
    54
    Quote Originally Posted by Sinndho View Post
    Did you associate your code with the Open event of the form?
    Yup, went to report properties > on open even > wrote code in VB just like that

  14. #14
    Join Date
    Jul 2011
    Posts
    54
    what if it needs to be a textbox?

  15. #15
    Join Date
    Jul 2011
    Posts
    54
    I give up

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •