Login to different websites from clicking access form button (1 Viewer)

Db-why-not

Registered User.
Local time
Today, 14:19
Joined
Sep 17, 2019
Messages
159
Hello,

I have an access database with Logins table and with fields: UserID, Password, WebAddress. I have a form (Auto_Logins) that displays these 3 text fields, and buttons to scroll through all the individual records in my Logins tables. Then I have a Login button that I want to trigger internet explorer to open, navigate to the webaddress and take my UserId and Password from the form that is displayed and then login to the website. Is this possible with VBA code in access? I have been having trouble finding code or information on how to do this. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:19
Joined
Oct 29, 2018
Messages
21,447
Yes, in some cases/websites, that is possible. You would have to know the Form structure of the website though, because you may have to use the names of the controls on the website for your code.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:19
Joined
Sep 21, 2011
Messages
14,217
Someone was wanting to exactly the same thing a while ago.?
Try searching the site with some relevant keywords.

Edit: This was the one I was thinking of
 

Db-why-not

Registered User.
Local time
Today, 14:19
Joined
Sep 17, 2019
Messages
159
Yes, in some cases/websites, that is possible. You would have to know the Form structure of the website though, because you may have to use the names of the controls on the website for your code.
So you probably wouldn't be able to do this for several different types of website. Each website can use different names for the userid and password controls?
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:19
Joined
Sep 21, 2011
Messages
14,217
So you probably wouldn't be able to do this for several different types of website. Each website can use different names for the userid and password controls?
Just store anything you need to log in, in a table
Not sure how you would cope with different element names though? Eval() perhaps?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:19
Joined
Oct 29, 2018
Messages
21,447
So you probably wouldn't be able to do this for several different types of website. Each website can use different names for the userid and password controls?
The reason why it might or might not work depends on how the website was designed by the web developer. That's all.
 

isladogs

MVP / VIP
Local time
Today, 20:19
Joined
Jan 14, 2017
Messages
18,208
Are you aware that you could do all of this within Access by using a Web browser control
 

Isaac

Lifelong Learner
Local time
Today, 12:19
Joined
Mar 14, 2017
Messages
8,774
Even if you use a webbrowser control, you will still essentially be automating I.E. object model. (I'm no expert on this, but have dabbled from time to time). I mean, my purpose for saying that is that much of the code will be belonging to the same object models, etc.

A few things that may be relevant:
- Look into GetElementByID for referencing a particular element in a website underlying structure. This is not the only method, but is common.
- In order to know what the ID actually is, right click on a webpage and View Source, or, if you're comfortable, use a browser that provides a more in depth way of slicing and dicing the structure, like Firefox.
- Remember that some webpage functionalities may be a simple call to a hidden Javascript or other function and everything you need may not always be exposed in the HTML that you can view as an end user.
- When it comes to submitting information, sometimes you can get away with just using Forms(1).Submit or Forms(0).submit, for simple pages that don't have anything other than that submittal form on them.

Here is a thread I was in recently that might help?
Automating a webpage inside a Webbrowser control
Note my Post 3 comments about the article I stumbled across, which I think is one of the most comprehensive and useful deep-dive into automatic web content inside Webbrowser controls that I'd ever seen.
 

Users who are viewing this thread

Top Bottom