roxannep
Technical User
- Jun 20, 2000
- 69
I have set up a module to run "OnClick" from a form button. In putting in the DoCmd.OutputTo line, I keep getting errors telling me that I don't have an Object Type listed. Since I am trying to export the string as it is and there is no form or report that it attachs to, I must be missing something?
Private Sub CmdButton_Click()
Dim db As Database, rst As Recordset
Dim a As Integer, HTMLCode As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("qryHTMLRecords"
rst.MoveLast
rst.MoveFirst
For a = 1 To rst.RecordCount
' Infomation could also change here
HTMLCode = Chr$(60) & "img src" & Chr$(61) & Chr$(34)
HTMLCode = HTMLCode & " HTMLCode = HTMLCode & rst![FileNo] & ".jpg" & Chr$(34) & Chr$(62)
DoCmd.OutputTo acOutputQuery, "qryHTMLRecords", acFormatRTF
rst.MoveNext
Next
DoCmd.Close
End Sub
Private Sub CmdButton_Click()
Dim db As Database, rst As Recordset
Dim a As Integer, HTMLCode As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("qryHTMLRecords"
rst.MoveLast
rst.MoveFirst
For a = 1 To rst.RecordCount
' Infomation could also change here
HTMLCode = Chr$(60) & "img src" & Chr$(61) & Chr$(34)
HTMLCode = HTMLCode & " HTMLCode = HTMLCode & rst![FileNo] & ".jpg" & Chr$(34) & Chr$(62)
DoCmd.OutputTo acOutputQuery, "qryHTMLRecords", acFormatRTF
rst.MoveNext
Next
DoCmd.Close
End Sub