Newest Challenge: Opening and logging into 3rd party app via Access button (1 Viewer)

Wapug

Registered User.
Local time
Today, 16:15
Joined
Apr 14, 2017
Messages
51
So my newest challenge is creating a button from which I can open another application, and then enter a userid and password in the form that pops up for that application. I have an example below of my method to open the application, Im not sure what to do after this. Would this be specific to the application? If so could you give me an example of how it might be done in a typical situation? Thanks in advance for your information.

Private Sub Command0_Click()
Dim stAppName As String
stAppName = "C:\Program Files\BobsBacon.EXE"
Call Shell(stAppName, 1)
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:15
Joined
Oct 29, 2018
Messages
21,473
Hi. Just a guess but if you're trying to manipulate another application that's not an Access database, then you would probably need some Windows API for it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:15
Joined
Feb 28, 2001
Messages
27,183
To amplify theDBguy's comments (which are quite right)...

The reason you can manipulate Excel is because it "exposes" its controls via the Component Object Model (COM) via libraries. Usually they are .DLL files but others work as well. So in the application's VBA Code page, Tools>>References lets you add library links to your app. In order to do what you suggest through code, it is going to be easier if your 3rd party app ALSO exposes its properties and methods through COM methodology. Otherwise, you will have a pot-load of issues.

You might do better to just launch the 3rd-party app and move it to the top of the screen-stack. Then from the form that launched it, wait for that form to get focus again through either the Activate or Enter events. You would do that by allowing the button-click code to just End Sub once that launch and repositioning is done.

Then the 3rd-party app could just ask its question without your intervention and could "do its thing."

If your goal is to simulate a "password tracker" system that remembers and applies your passwords automatically, then you will need to look at some pretty complex code unless this putative 3rd party app uses COM technology.
 

Wapug

Registered User.
Local time
Today, 16:15
Joined
Apr 14, 2017
Messages
51
Thank you for the information.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:15
Joined
Oct 29, 2018
Messages
21,473
Thank you for the information.
Hi. You're welcome. Doc and I were happy to assist. Good luck with your project. Please let us know how it goes.
 

Wapug

Registered User.
Local time
Today, 16:15
Joined
Apr 14, 2017
Messages
51
I think I need to forget about doing this, Im not sure I know how to open the application, let alone begin to enter a user id or password. I can open Excel or word, but that's about it.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:15
Joined
Oct 29, 2018
Messages
21,473
I think I need to forget about doing this, Im not sure I know how to open the application, let alone begin to enter a user id or password. I can open Excel or word, but that's about it.
Right. It would highly depend on the app you're trying to open and manipulate from Access. Some may work, some may not. Cheers!
 

Users who are viewing this thread

Top Bottom