Hey everyone, Daniel here from TwinBytes with another quick tech-torial for you.
This time with Microsoft Access and making a link to a website URL or for sending an email using your built-in
email client. There's been many videos I've seen that show you how to create a web browser inside
of MS Access, but I haven't seen any that show you how to create a button such as this one, where when
you click on it, it launches your web browser and takes you to the website of your choice.
Also having a button like this where you click on it and it launches your email client where
it fills in the email address that you want to send it to, as well as a subject that you
would like to have pre-filled in for the person emailing you.
All this coming up!
So this is assuming you already have basic knowledge of Microsoft Access. We want to go into
design view and we want to go in the properties of this button. What we want is an on click event.
So under the events tab if you're not already on that tab, make sure you're on events, and under on click,
hit the little three dots button and we want to go into code builder.
We'll hit ok and this is where we're going to type in our code for what we want to happen when we click on this button.
It starts off with application and when you hit a dot it's giving you a drop down menu with
all the different features you could possibly make use of. We're going to type in follow hyperlink but
as soon as you type in follow you'll see it finds it there, so you can just hit tab.
We'll add a space and it gives you a tool tip which
is a little bit overwhelming to look at but I'll show you the rest. Type in address, colon,
equals sign, and then you want to have a quote for open quote and then put in
the address. So including HTTPS ideally if it is secure with the colons and slashes
and then put in the website address, including the full path, if it is requiring that.
Don't forget to put the close quote at the end and that is the full link to....
all the code to make a clickable link. So if we close out of there. We've now got this button
that will launch that website. So we can save this, go to the form view and we'll try this.
and it works!
Next is this request customization button we want to make.
So we'll go back to design view and go into request customization.
under events, on click, in the three dots, code builder,
okay and for this button it's actually starting off with the exact same code, which I can't type.
Address, colon, equals, this is where it's different here after the open quote. It's mailto, and then a
colon and then put in the email address that you want to send this to; and you could just put a
close quote here and finish it off and that's the end of it. But what we want is to add a subject to it.
So you put in a question mark and subject equals whatever you want the subject to say.
Don't forget to put in the close quote at the end and that is the end of the code for that.
So the only thing different between the two of them instead of HTTP it's mailto. Then you have the
option of putting in the subject. You can stop right after the email. Don't put in the question
mark if you're not going to use subject. That's only if you're going to add the subject part in.
So we close out of there, save that, go back to the form view and hit the button. It should launch our
email client; and it's pre-filled in, where is it going to, what the subject is, and now
you're free to start typing in your email. So that's it for this quick tech-torial. I hope you
guys did find it helpful. If you did please do give it a thumbs up, subscribe if you
haven't already, and ring the bell to be notified every time we come out with a new video.
and if you really do want to donate to my channel, it helps me keep these videos free for everyone
and there is a link to my Paypal account in the description in the video below.
Thanks so much for watching. We'll see you in the next one. Bye for now.