Catching errors for hyperlink to form (2 Viewers)

Martynwheeler

Member
Local time
Today, 11:07
Joined
Jan 19, 2024
Messages
82
I have a form with a hyperlink to another form.

If the called form has no data it will redirect to another form (all handled in the form_open event). However, because the link has now redirected it throws the warning message as the second form opens.

1708531233311.png


If i click ok, then everything is fine. I would just like to somehow suppress this message. There does not seem to be any event handler that gets called before the hyperlink is followed so that I can handle errors.

I have enclosed the database (it is split so i have zipped it up).

The behaviour can be reproduced by selecting a paper on the first form that loads and then clicking the "view existing paper" hyperlink

The image files have not been included in the db

Thanks
 

Attachments

  • OCR_Questions.zip
    365.6 KB · Views: 26

theDBguy

I’m here to help
Staff member
Local time
Today, 03:07
Joined
Oct 29, 2018
Messages
21,473
There may be a way to fix your problem with the hyperlink, but it may be easier to just use the Click event instead of using a hyperlink. Just a thought...
 

Martynwheeler

Member
Local time
Today, 11:07
Joined
Jan 19, 2024
Messages
82
Thanks, I liked the way the hyperlink looked, but I guess i can reproduce that. I also just discovered you can call a macro with a hyperlink in which you can handle errors. Pity I can't just handle them in vba. I can call a module but not sure how that would work.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:07
Joined
Oct 29, 2018
Messages
21,473
Thanks, I liked the way the hyperlink looked, but I guess i can reproduce that. I also just discovered you can call a macro with a hyperlink in which you can handle errors. Pity I can't just handle them in vba. I can call a module but not sure how that would work.
Maybe you can just use the macro to call your vba.
 

Martynwheeler

Member
Local time
Today, 11:07
Joined
Jan 19, 2024
Messages
82
So, I discovered that if I type a space into the hyperlink property it gives me the hyperlink formatting (with mouse pointer as hand) and I can handle the click in code.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:07
Joined
Oct 29, 2018
Messages
21,473
So, I discovered that if I type a space into the hyperlink property it gives me the hyperlink formatting (with mouse pointer as hand) and I can handle the click in code.
Excellent!
 

Users who are viewing this thread

Top Bottom