Sorry for not making my post clear.
Ok,
- Are you saving the value? Yes, I am saving it to String LInum.
- Are you manipulating the value? No.
- Are you loading or updating information in a database? No. The Input from the user is used to query a website.
- Are you closing a form or opening a new form? No.
- Are you passing this value to something else? To Sub Command3()
- Are you pasting this value in another text box? No.
* User inputs 7 numbers (0-9)
* After the 7th key is pressed Command3 is called.
** Also is there a way for Access to detect the keystrokes in real time?
Private Sub Command3_Click()
Call LogIn ' Logs in to Website
Dim LInum As String
Set ie2 = CreateObject("InternetExplorer.Application")
ie2.navigate "
& LInum & "&Type=Job"
'LInum is used above to query an specific page.
ie2.Visible = True
While ie2.Busy
DoEvents
Wend
'...
End Sub
Sub LogIn()
Const strUsr_c As String = "qcc04"
Const strPwd_c As String = "qc"
Dim ABC As MSHTML.HTMLInputElement
Dim DEF As MSHTML.HTMLInputElement
Dim ABC1 As MSHTML.HTMLInputElement
Dim DEF2 As MSHTML.HTMLInputElement
Dim btnSubmit As MSHTML.HTMLInputElement
Dim btnSubmit1 As MSHTML.HTMLInputElement
Set iekickoff = CreateObject("InternetExplorer.Application")
iekickoff.navigate "
While iekickoff.Busy
DoEvents
Wend
Set ABC1 = iekickoff.Document.all.Item("loginidtextbox")
Set DEF2 = iekickoff.Document.all.Item("passwordtextbox")
Set btnSubmit1 = iekickoff.Document.all.Item("logonButton")
ABC1.Value = strUsr_c
DEF2.Value = strPwd_c
btnSubmit1.Click
While iekickoff.Busy
DoEvents
Wend
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "
While ie.Busy
DoEvents
Wend
Set ABC = ie.Document.all.Item("loginidtextbox")
Set DEF = ie.Document.all.Item("passwordtextbox")
Set btnSubmit = ie.Document.all.Item("logonButton")
ABC.Value = strUsr_c
DEF.Value = strPwd_c
btnSubmit.Click
ie.Visible = 1
End Sub