Here's an odd one. I have a simple Printout macro on a command button on a subform that looks like:
Code:
OpenReport MemberCardL,Report,,,Normal
PrintOut All,,,High,1,Yes
Close Report,MemberCardL,Yes
This works fine as such. However, I need to combine the printout action with an update query on the same command button. But when I convert the macro to VBA thusly:
Code:
Private Sub Command30_Click()
DoCmd.OpenReport "MemberCardL", acViewPreview
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "MemberCardL", acSaveNo
End Sub
and run it I get an error message, "The expression On Click you entered as the event property setting produced the following error: A problem occurred while Radius Admin. System was communicating with the OLE server or ActiveX Control."
The help for that error says
"This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired."
I can't find any property that would trip up VBA as compared to the macro, and there is lots more command button VBA code on the same subform that works fine. Has anyone seen this situation before?