Full Version: close a form after hyperlink click
UtterAccess Forums > Microsoft® Access > Access Forms
valkster
Hello. Does anyone have a method of closing a form after a user clicks on a website hyperlink on that form? I have a supplier form that contains general information about the supplier, as well as specific contacts from that supplier. I have a few email hyperlinks and one corporate website hyperlink for each supplier. This form is initiated from within an order form. Basically, when the user is within the ordering form they can double-click a command button to display contact information from that supplier (the form with the hyperlinks). If they select any of the hyperlinks I would like to close that supplier form. I am new to the hyperlink fields of '07 and would appreciate any insight. So far I cannot find any "On Hyperlink" events or similar that will allow me to close the form.
incerely,
Mark
freakazeud
Hi,
you could try to use code in the click event of the control that is bound to your hyperlink field e.g.:
oCmd.Close acform, Me.Name
HTH
Good luck
valkster
Hey, thanks for the input but the way the hyperlink works seems to prevent this. The hyperlink will not run with code in this event location (the form closes but internet explorer will not launch). I had tried closing the form with a click event, on lost focus event and an after update event. One causes the hyperlink to not work at all, the other two events don't seem to activate during a hyperlink. Thanks, does anyone know how a hyperlink interacts with events (if at all)?
freakazeud
Hi,
I guess you will have to force the hyperlink with code first in the click event and then close the form e.g.:
e.YourHyperlinkControlName.Hyperlink.Follow
DoCmd.Close acForm, Me.Name
HTH
Good luck
valkster
Ah, great! That did it. Any chance there is a way to open the link in normal view? It works but the IE screen is minimized. Thanks so much for your help.
incerely,
Mark
freakazeud
You would need to use code to extract the actual hyperlink address and then use the Shell method which has a window argument at the end to force a maximized window opening.
HTH
Good luck
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.