Kelvan here is the code attched to a form
'***************************************************************************************
'This form allows the user to select a printer for a report. It return the
printer number and
'sets var varTempPrtNum to the selected printer number or sets varTempPrtNum
to 99 if the user
'closes without selecting a printer.
'***************************************************************************************
Private Sub Form_Load()
Dim prtLoop As Printer
Dim varNum As Integer
DoCmd.MoveSize 3000, 2000, 6000, 9000
varNum = 0 '[..Sets public var to 0.]..
For Each prtLoop In Application.Printers
With prtLoop
[Printer Name] = UCase(.DeviceName)
[Printer Num] = varNum
varNum = varNum + 1
End With
DoCmd.GoToRecord , "", acNewRec
Next prtLoop
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
Me.DataEntry = False
End Sub
Private Sub CloseButton_Click()
DoCmd.Close
DoCmd.OpenQuery "DeletePrinters" '[..Remove this users installed printer
from the database.]..
varTempPrtNum = 99 '[..I will be able to use this to see if the user
closed without selecting
'a printer.]..
End Sub
Private Sub Printer_Name_DblClick(Cancel As Integer)
Dim varPrtTemp As Printer
varTempPrtNum = [Printer Num]
DoCmd.Close
DoCmd.OpenQuery "DeletePrinters" '[..Removes this users installed
printer from the database.]..
Set Application.Printer = Application.Printers(varTempPrtNum) '[..Sets
application printer to the
'selected
printer number/]..
Set varPrtTemp = Application.Printer
With varPrtTemp
MsgBox ("You selected " & .DeviceName)
End With
End Sub