Report not converting to html correctly on event for one new user only

coffeeman

Registered User.
Local time
Today, 11:55
Joined
Oct 13, 2008
Messages
58
We have an access database that roughly 10 people use in Access 2010. We recently had a new employee join us and she is unable to run 2 different events that convert a report into an html document and send it in the body of the email. It works for everyone else but she gets this error when she tries to run the event procedure. All references are selected the same. I am assuming since she is new, it could be a user not authorized issue.

Here is the error: "No Current Record"

Here is the code:

Private Sub Command6_Click()

On Error GoTo Err_Command6_Click

exporttohtml

Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub

Sub exporttohtml()

Dim strline, strHTML As String

Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem

Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)

With MyItem
.To = joe@blah.com
.CC = ""
.BCC = ""
.Subject = "Daily Coffee Received Report"
End With

DoCmd.OutputTo acOutputReport, "DailyCoffeeReceived", acFormatHTML, "C:\myreport1.html"

Open "C:\myreport1.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
' If OL2002 set the BodyFormat
If Left(OL.Version, 2) = "10" Then
MyItem.BodyFormat = olFormatHTML
End If
MyItem.HTMLBody = strHTML
MyItem.Display
'MyItem.Send


End Sub

Thank you for any help!
 
Maybe she only drinks tea?

That error probably stems from the DoCmd.OutputTo - line, in which case the interesting code woul be the one generating the report. Why not disasble the error handlers and check where exactly the error is generated? THe debugger will stop on that line... provided you also disable the error handling in the report
 
It is happening on the docommand line.

It just doesnt make sense it is only on her computer and not others.
 
I can assure you it WILL make perfect sense, once the reason is found :-) So try to do what I suggested
 
I did what you said and it is the do.command it is stopping on:

DoCmd.OutputTo acOutputReport, "DailyCoffeeReceived", acFormatHTML, "C:\myreport1.html"

It is as if it is not allowing the user to save the or output the file to the designated C:\ destination. Could this be a permission thing?
 
Are you able to run the report? Simply open it manually? Because the error message implies it's the report itself.
 
Yep. I have tried that. Preview of the report is no issue and even printing. I think she is having some sort of user limited rights. It says she is a "standard" user and not an administrator. As a test, I saved a word document and then tried to save it directly to her C:/ and it would not allow me. I guess I will need to contact our server company and get them to change her permissions.

Thanks for the help. Allowed me to narrow it down to the issue and confirm it probably isnt an access issue.
 

Users who are viewing this thread

Back
Top Bottom