Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Mar 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TEXT BOX (ACCESS 97)

    HI TO EVERYONE,

    I'M TRYING TO PRINT A REPORT OFF A QUERY. ON THE HEADER, I ADDED A TEXT BOX THAT WOULD CAPTURE THE MO/YR ENTERED AS PARAMETER VALUE. I'M USING =[MO/YR] AS THE CONTROL SOURCE FOR THIS TEXT BOX. SO FAR IT'S DOING WHAT IT'S SUPPOSE TO DO. HOWEVER, IF MY REPORT CONTAINS NO RECORD IT JUST GIVES ME AN ERROR INSTEAD OF DISPLAYING THE PARAMETER VALUE THAT WAS ENTERED INITIALLY. HOW CAN I CORRECT THIS ERROR? THANKS FOR YOUR HELP.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TEXT BOX (ACCESS 97)

    Hello,

    Welcome to the Lounge. Please don't write ALL CAPS, it is considered the equivalent of shouting.

    If the query returns no records, you can't get the value of the parameter. As a workaround:
    <UL><LI>Create a form with a text box txtMoYr and a command button cmdOK. Make the command button open the report; the easiest way to do this is through the command button wizard. Let's say that you save the form as frmParameter.
    <LI>Open the query in design view, and change the parameter [MO/YR] to [Forms]![frmParameter]![txtMoYr]. Save the query.
    <LI>Open the report in design view, and change the Control Source of the text box in the report header from =[MO/YR] to =[Forms]![frmParameter]![txtMoYr]. Save the report.[/list]The text box in the report header now refers to the text box on the form. Even if the report does not display any records, thetext box will still display the value entered by the user on the form.

  3. #3
    Lounger
    Join Date
    Mar 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TEXT BOX (ACCESS 97)

    Hello,

    Thanks for the advice. Before I could even try it, my co-worker already read your reply and did what you said. He realized that he already posted this question a a year or so ago but just forgot about it. Now our report is working fine. Also, I apologize for the "ALL CAPS" posting. I totally forgot it.

    Hope all is well.

    Jomel

Posting Permissions

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