I have the following code which works great on all but 3 of our computers. On those computers it hangs indefinitely on the "set" command. It doesn't seem to matter what the default printer is that is selected or what user is logged into the PC.
Private Sub Form_Open(Cancel As Integer)
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers(strDefaultPrinter)
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[employee]=" & "'" & Environ("UserName") & "'"
stDocName = "Mainpage"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
End Sub
Any suggestions would be greatly appreciated!
Private Sub Form_Open(Cancel As Integer)
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers(strDefaultPrinter)
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[employee]=" & "'" & Environ("UserName") & "'"
stDocName = "Mainpage"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
End Sub
Any suggestions would be greatly appreciated!