Alright, I have a large amount of people clicking on an app I wrote some years ago. The backend database has always been in access, but due to the large volumn of people and REALLY POOR vpn connections.. I am trying to use google forms to start tracking activity. It seems to be working great, I just have a couple problems.
First, let me show you the form here... feel free to try it out, Once the issue has been marked solved I am going to edit this thread to take the live form URL out.
Code:
Dim oIe As InternetExplorer Dim User, Pass As String
Dim strUser, strPass As String
Dim Uname As String
Dim ctlCurrentControl As control
Dim strControlName As String
Dim db As Database
Set db = CurrentDb
Uname = Environ("username")
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name
Set oIe = FindIE("Google FOrm URL")
If oIe Is Nothing Then
Set oIe = Login("Google form url", True)
End If
Call SleepIE(oIe)
oIe.Document.all.Item("entry_896438412").Value = Uname
oIe.Document.all.Item("entry.1614432791").Value = strControlName
oIe.Document.all.Item("entry.777398801").Value = Now
oIe.Document.all.Item("entry.925840023").Value = db.Properties("AppTitle").Value
oIe.Document.all.Item("submit").Click
Call SleepIE(oIe)
oIe.Navigate ("Google form url")
End Sub
Okay, the first problem I am having is on the initial load of the form I receive a crazy error that states
Code:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; QAM; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3; Tablet PC 2.0)
Timestamp: Fri, 31 Oct 2014 14:09:25 UTC
Message: Object doesn't support this property or method
Line: 167
Char: 114
Code: 0
URI: https://docs.google.com/static/forms/client/js/3191719111-formviewer_prd.js
And the second thing I have not figured out is how to capture the Application Title in access. I could just hardcode the text I want, but I plan on rolling this out to 5 or 6 different applications, so to have it dynamic would be the best solution. (Fixxed, found this "CurrentDb.Properties("AppTitle")" and it works just fine!