Instead of completely hijacking another thread I figured I'd start my own.
I have a database (access 2007) that tracks training information for my site and to expedite some of the processes we have to follow I've incorporated IE automation in my db. The website I'm connecting to is a third party and does have a password protected site but I doubt the site specifics will be necessary for what I need.
I'm having issues with copying a table in my database ("tblCE_QBTest") and pasting the contents into a form on IE (6.0). I have the correct element ID as I've been able to manually insert text into the form however I can't figure out how to paste the table's data.
My tblCE_QBTest has 3 fields:
-Related Class
-Related Student
-Status
I need the contents of all three fields pasted into the form.
here is my existing code:
I have a database (access 2007) that tracks training information for my site and to expedite some of the processes we have to follow I've incorporated IE automation in my db. The website I'm connecting to is a third party and does have a password protected site but I doubt the site specifics will be necessary for what I need.
I'm having issues with copying a table in my database ("tblCE_QBTest") and pasting the contents into a form on IE (6.0). I have the correct element ID as I've been able to manually insert text into the form however I can't figure out how to paste the table's data.
My tblCE_QBTest has 3 fields:
-Related Class
-Related Student
-Status
I need the contents of all three fields pasted into the form.
here is my existing code:
Code:
Private Sub Mix_Click()
On Error Resume Next
Dim IE As Object
Dim document, element
Dim btn As HTMLButtonElement
Dim rs As ADODB.Recordset
'Dim db As ADODB.Database
Set IE = CreateObject("internetexplorer.application")
IE.Navigate "[URL unfurl="true"]https://www.quickbase.com/db/bc68fkzzg?a=ImportExport"[/URL]
IE.Visible = True
Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop
For Each btn In IE.document.all.tags("Input")
If btn.Value = "ImportClipboard" Then
Call btn.Click
End If
Next btn
'Loop unitl ie page is fully loaded
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Do Until IE.document.ReadyState = "complete"
DoEvents
Loop
IE.document.all.Item("table").Value = "bc68fkzzi"
Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'Section below is the part I'm having issues with as
'it stands it's only pasting one record and not from all 'three
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM tblCE_QBTest", CurrentProject.Connection, adOpenForwardOnly, _
adLockReadOnly, adCmdText
Do While Not rs.EOF
IE.document.all("clipboarddata").Value = rs("Related Class")
IE.document.all("clipboarddata").Value = rs("Related Student")
IE.document.all("clipboarddata").Value = rs("Status")
rs.MoveNext
Loop
rs.Close
'commented code below works alone to put data in form
'IE.document.all.Item("clipboarddata").Value = ("hey")
Set rs = Nothing
'Loop unitl ie page is fully loaded
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Do Until IE.document.ReadyState = "complete"
DoEvents
Loop
'Commented out until I can get copy/paste working
'For Each btn In IE.document.all.tags("Input")
'If btn.Value = "Import Data..." Then
'Call btn.Click
'End If
'Next btn
Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop
Set IE = Nothing
End Sub