B
biganthony via AccessMonster.com
Hello,
I have a list box on a form that displays the printers attached to the
computer. The lst box is called lstPrinters and I use the following code in
the form's Open event to populate the list box:
For Each prt In Application.Printers
Me!lstPrinters.AddItem prt.DeviceName
Next
This works well, except when I open the form on my laptop when the laptop is
not connected to the work network and the printers are not valid. All the
printers on my laptop are network printers used at work (using Novell iPrint).
Is there a way to add a timer that, say, after 30 seconds, the loop times out?
At the moment, the form is hanging because I have not logged onto a network
and therefore the attached network printers are no longer available. I was
thinking that maybe there could be a counter but I am not sure whether it
goes within the For-Loop. I put it outside the For-Loop and the form still
hanged. At the moment, there are about 10 printers installed in Windows but
none of them are attached either directly or through a network as I am using
local workstation connected to an open wirless network.
I hope this makes sense.
Thanks,
Anthony.
I have a list box on a form that displays the printers attached to the
computer. The lst box is called lstPrinters and I use the following code in
the form's Open event to populate the list box:
For Each prt In Application.Printers
Me!lstPrinters.AddItem prt.DeviceName
Next
This works well, except when I open the form on my laptop when the laptop is
not connected to the work network and the printers are not valid. All the
printers on my laptop are network printers used at work (using Novell iPrint).
Is there a way to add a timer that, say, after 30 seconds, the loop times out?
At the moment, the form is hanging because I have not logged onto a network
and therefore the attached network printers are no longer available. I was
thinking that maybe there could be a counter but I am not sure whether it
goes within the For-Loop. I put it outside the For-Loop and the form still
hanged. At the moment, there are about 10 printers installed in Windows but
none of them are attached either directly or through a network as I am using
local workstation connected to an open wirless network.
I hope this makes sense.
Thanks,
Anthony.