Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2004
    Posts
    4

    Question Unanswered: Can't follow the hyperlink - ignore messagebox

    Hi all,

    I'm in need of a little help of the access guru's out there. This is the situtation. I have a little switchboard which uses labels that functions as hyperlinks to other forms in my access application. Now, on some occations these forms may not be opened by the user. Therefore I've written some code in the open event of the forms in question. If some conditions are met, I display a messagebox and finish by cancelling the opening of the form. Now this causes access to trigger an "MS Access can't follow the hyperlink" error and with it, it displays an Access native messagebox. Obviously, I don't want this messagebox because I allready informed the user why he/she can't open the form. How do I prevent Access to open this messagebox, or how do I avoid the opening of it?

    Any help will be much appreciated.

    Thanks in advance,

    V.W.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Where are you opening the form from? It sounds like you've put your code in the target form, when it should be in the calling form.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jun 2004
    Posts
    4
    Indeed. The 'cancel=true' line is inside the target form (in the on open event). Is it possible then to do some checking of the target form before following the hyperlink to that form? If that is the case then my problem is solved of course.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What criteria are you evaluating in the on open event that isn't present BEFORE you open the form?

    If you were to move these criteria checks to the "calling" form, and only execute the DoCmd.OpenForm method AFTER all the criteria has been checked out, then you simply never open the form to begin with.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Jun 2004
    Posts
    4
    yes of course, but this would imply the use of the docmd.openform method. I'm using here a label with the hyperlink propery set to a form in my application. The reasen therefore is that with hyperlinks the mouse icon is automatically changed to a hand, which gives a good indication to the user. So I can't use the docmd.openform method here because I think that the following of the hyperlink occurs before the click event of the label in question.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I see....

    well, this is a bit of a hack, but you could keep the hyperlink property set to true (along with your helptips and so forth), but leave the hyperlink itself blank, and instead use the on click event to do the actual navigation? This would give you the desired "mouse-over" effect, coloring, etc while giving you better control over the event handling.

    It's a little ghetto, but it would work...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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