Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    6

    Unanswered: Cancel External Form

    Heya

    I can usually just search and find answers to all my probs (so thanks :P) but I cant this time...

    Basically, I need a bit of code that will let me cancel the running of a form, from another form or report. I can give ya exactly what I'm doing, but, all I need is exactly what I said

    The idea seems REALLY simple, but I can't manage to get it working


    Cheers people
    Luke
    Last edited by Lateralus; 11-21-04 at 19:34.

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Luke and "Welcome to the Forum"

    Not really knowing your entire situation, at first glance I would have to say that the only way a form will only run from another form or report is that you code it to do so in the first place. If you have done so, then simply remove the process of how you set it to run initially. Take a look at whatever Form or Report that is being used when this other Form is being called up check any code behind it to see where it is calling up the Form. Look in the code for the name of the Form and see about removing or remarking out that bit of code. Other than that I'm not really sure of what is going on without seeing it. Someone else may be able to offer a bit more so if this doesn't do it for you just hang on, someone will be here soon.

    hope you enjoy this site, a great place to be,
    have a nice one,
    BUD

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Try:

    DoCmd.Close acForm, "Order Review", acSaveYes


    Call it from where you will ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Sep 2004
    Posts
    6
    Hey

    Cheers Bud, but it's sorta called from the same form, but...lol, i'll explain below...
    M Owen, I need to cancel the form, not close it. cheers tho

    Ok, basically, I had a report that relies on certain criteria input by the user. When the criteria was not met (no results were found) I got an ugly error. I used the "NoData" property to fix that.

    However, when it comes to opening the report from a form (based on a textbox) it doesnt work. If I enter a value which DOES have records, everything works perfectly in the report. But, if I enter a value that doesn't (but is still valid) I get my message box (from what I explained above) but then get an error saying "The OpenReport Action Was Cancelled" or something...

    Any ideas?

    Cheers again

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Lateralus
    Hey

    Cheers Bud, but it's sorta called from the same form, but...lol, i'll explain below...
    M Owen, I need to cancel the form, not close it. cheers tho

    Ok, basically, I had a report that relies on certain criteria input by the user. When the criteria was not met (no results were found) I got an ugly error. I used the "NoData" property to fix that.

    However, when it comes to opening the report from a form (based on a textbox) it doesnt work. If I enter a value which DOES have records, everything works perfectly in the report. But, if I enter a value that doesn't (but is still valid) I get my message box (from what I explained above) but then get an error saying "The OpenReport Action Was Cancelled" or something...

    Any ideas?

    Cheers again
    If you put a "On Error Resume Next" before your report call that will eliminate the error...

    What do you mean by "Cancel" ??? Usually when you cancel something you're closing it... You don't leave an incomplete form sitting open ...
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Sep 2004
    Posts
    6
    Hey cheers man that worked perfectly thanks a lot

    sorry about the cancel confusion, i think i confused myself as to what i needed


    cheers man
    Luke

Posting Permissions

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