Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide Parameter Box (2002)

    Hi,
    Long time, no post. Ok, I had a baby and have been out of the work force for 10 months. I am now getting back into work part time and my Access cob webs are clearing slowly. I have an unbound form with a date field and an OK button that when that is clicked on it opens the report that is based on the Query that points to the unbound form for its criteria. The problem is when I click my cancel button, I want it to close the form. It does close the form, but after I close the form the Parameter dialog box that Access shows when theres no data appears and I can't seem to get that box to not show. Any ideas on what I'm doing wrong?
    Thanks,
    Deb

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

    Re: Hide Parameter Box (2002)

    Hi Deb,

    Congratulations!

    Do you really mean a parameter box, or a message box? And what is the code behind the Cancel button?

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Parameter Box (2002)

    I mean the box that comes up to prompt you to enter the parameter value. It shouldn't appear because its supposed to be getting its value from the unbound form. The cancel button has a macro attached to the on click event, that has the Close Action and then the msgbox action.
    Thanks,
    Deb

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

    Re: Hide Parameter Box (2002)

    I fear I'm missing something.
    - The OK button opens the report which uses the value form the form.
    - The Cancel button closes the form, I assume without opening the report. So there should be no reason for the parameter prompt to appear. Or is the report open when you click the Cancel button?

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Parameter Box (2002)

    Ok, as always Hans I appreciate your help. I am working on some elses db and I found some error in their logic. Basically they have a report that is based off a qry that has a parameter value and that value points to an unbound text box on an unbound form to get its data. Well they were opening the report first then opening the form to get the data. Backwards....so thats why that box was coming up.
    Thanks,
    Deb

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Hide Parameter Box (2002)

    To catch for this mistake you can check whether the form is loaded in the OnOpen event of the report.

    This event has a Cancel parameter which can be set to true to stop the report opening.

    If Not isLoaded(formname) then
    msgbox "Form not open - report cannot be opened without it."
    cancel =true
    end if
    Regards
    John



Posting Permissions

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