I am trying to open a report from a form with the current record that is open on the form. The report is called NEOFormR and the common ID is personalID.
I am using the following code linked to a button
DoCmd.OpenReport "NeoFormR", acpreview , , "[PersonalID]=" & [PersonalID
Then when I try and run it I get the following error.
The expression on click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or Active X Control
I have tried changing my code to the text string form
DoCmd.OpenReport "NeoFormR", acpreview , , "[PersonalID]='" & [PersonalID & "'"
Also I tried running this with a simple macro and it would open the report but not to the correct record.