473,831 Members | 2,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

from combo box data - > Open website with username and password

99 New Member
I have a form with a combo box called "cmbWebsite s".

The combo box row source comes from a select query that returns rows:

0.WebsiteID
1.Website Name
2.Website URL
3.Username
4.Password

Only "Website Name" appears in the combo box. The other columns are set to zero length.

When the user selects a website, the AfterUpdate event will trigger code to build a string that contains the URL, Username and Password of the selected website, and runs it through the FollowHyperlink method.

The only thing I don't know how to do is format the hyperlink so the websites will accept the username and password and automatically get me into the site; like "Roboform".

Even though this isn't a pure MS Access question, I can't imagine that other Access developers haven't done something similar.

Does anyone know how to format a URL with Username and Password, so the FollowHyperlink method automatically gets you into the site?

Thanks,
Adam
Oct 30 '09
12 5429
AdamOnAccess
99 New Member
ok, I got pretty far with it but than got hung up at the last moment. Here's what is happening...

Expand|Select|Wrap|Line Numbers
  1. With Me!cmbWebSiteID
  2.    strURL = .Column(1)
  3.    strUNtag = .Column(3)
  4.    strUNtag = Chr(34) & strUNtag & Chr(34)
  5.    strPWtag = .Column(4)
  6.    strPWtag = Chr(34) & strPWtag & Chr(34)
  7.    strMyUN = .Column(6)
  8.    strMyPW = .Column(7)
  9.    strSubmitButton = .Column(5)
  10.    strSubmitButton = Chr(34) & strSubmitButton & Chr(34)
  11. End With
  12.  
  13.  
  14. Dim webBrowser As Object
  15. Set webBrowser = CreateObject("InternetExplorer.Application")
  16.  
  17. With webBrowser
  18.     .Navigate strURL
  19.     .Visible = True
  20.         ' loop until the page has finished loading
  21.         Do While webBrowser.readyState <> 4 Or webBrowser.Busy
  22.            DoEvents
  23.         Loop
  24.        ' username and password are the default element names - if they are different you need to figure them out and change accordingly
  25.        .Document.All.Item(strUNtag).Value = strMyUN
  26.        .Document.All.Item(strPWtag).Value = strMyPW
  27.        .Document.All.Item(strSubmitButton).Click
  28. End With
  29.  
When I run the code, I get this error message...

"Method 'Item' of Object 'NameOfForm' Failed"

The error occurs on this line:
.Document.All.I tem(strUNtag).V alue = strMyUN

if I remove the variable and run it as a fixed string like this...
.Document.All.I tem("Nick").Val ue = strMyUN

... with "Nick" being the actual name of the Username field on the HTML page, the code works perfectly.

Does anyone know how I can get it to run with the variable?

Thanks,
Adam
Nov 10 '09 #11
mshmyob
904 Recognized Expert Contributor
@AdamOnAccess
Just change your declaration for your elements (strUNtag, etc.) like so:

dim strUNtag

Don't try to add quotes or anything. Do not declare it as string or anything. Or leave out the declarations completeley and it will work.

cheers,
Nov 10 '09 #12
AdamOnAccess
99 New Member
Works great! Thanks MshMyob!
Nov 10 '09 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2771
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits and goes to the index file again, I can't figure out how it opens the chatroom. I want to get it to skip the login box and go straight to the room, with user name "guest" or "" or whatever but I'll add a field to type the name in the chat room....
8
1977
by: rikesh | last post by:
Hi I'm sure this is a very trivial problem! I have a combo bound to a recordset. I was wondering how I can show the value on the page, what the user has selected? The code that I'm using is below. Any help, would be much apprceciated. Kind regards
0
10334
by: hlabbott | last post by:
Hi I'm having a problem displaying attachments correctly. I have messages with attachments stored on Exchange2000 and want to be able to click a hyperlink in my project like in OWA and see an attachment. Because it is stored on Exchange I have to set a username and password so I do a GET request. The data I get back seems to still be encoded - trying to open an excel file for example results in it trying to open it but an excel...
11
2428
by: Patrick | last post by:
I have an ASP.NET application that connects to a SQL Server database. The SQL Server resides on a seperate development server from the IIS5.1 on Windows XP SP2 on development PCs which host the ASP.NET application. I would like to use Integrated Windows Authentication like Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBName;Data Source=DevServer1 My problems!
3
3788
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and password entered.My case now is I have Audit Trail Module which keeps records of modifications and current user, I wanted my audit trail to log the current user based on who has log from based on my Log in Form.please help ty HERES THE CODE FOR ON...
2
2568
by: SFM | last post by:
I just want a simple datareader, that i can read the value returned from a select statement executed on a SQL server 2005 db. The code below should work in, but email= rdr.ToString(); when i want to read some data a get a exception saying: System.InvalidOperationException was unhandled by user code Message="Invalid attempt to read when no data is present." Source="System.Data" StackTrace:
3
3020
by: jambonjamasb | last post by:
Hi I have two tables: email_tbl Data_table Data table is is used to create a Form Data_form
3
1892
by: Faisal Shah | last post by:
As the solution.. I have got this script code.. it's an open source so i can modify it.. The problem is it's a guest book script written in very highly and deeply php language that I am not able to understand all.. BUT I am here you guys can read and help me.. From this script i would need your help, You will have to separate 2 things <PLEASE> 1. Bunch of code, Which writes message and gives a unique id to each entry...SO identified...
4
4284
by: tokcy | last post by:
HI every one, i am using tooltip on click of link and i want like when that tooltip open then background window would be blure(). can anyone help me...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10538
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10210
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.