FIrstly, thanks to everyone for the help. But I still am having no luck. The code I have tried has varied from putting in a loop to wait 3 seconds and then close to using a while 'err.num=2585 do'loop to continue trying to close. The description of this error is
'This action can't be carried out while processing a form or report event.'
That happens with this code:
-------------
Private Sub Form_Current()
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
DoCmd.Close
End Sub
-----------
However, If I attach this same code to a button, and press it as soon as I can, the code executes perfectly. Print, close, no fuss, no muss. However, I don't really want the users to even see this second form. I just want it to print and close. This is linked to another form which is set to open this one.
I cannot determine what 'form or report event.' it believes is running.
Below is some other code I had tried (suggested on another forum) This infinite looped me.
Private Sub Form_Activate()
on error goto Err_Form_Activate
Dim Start
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Close_Form:
DoCmd.Close
Exit_Form_Activate:
Exit Sub
Err_Form_Activate
If Err.Number = 2585 Then
Start = Timer ' Set start time.
Do While Timer < Start + 3
'Loops until time has passed , 3 = 3 seconds, change as needed
Loop
else
MsgBox Err.Description
End If
Resume Close_Form
End Sub