Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MultiSelect looses highlight problem - impossible problem

Status
Not open for further replies.

TrollBro

Technical User
Sep 4, 2004
98
US
I'm baffled.

I have a simple form with an unbound listbox, rowsource is a select statement. A command button has code to read the number of selections highlighted, and then calls a function to take info from each record and populate a Word template. Works fine.

I have another form, same idea, different rowsource data and different Word template, with separate vba coding - i.e. same coding as the first but renamed variables. All form properties are the same. That code works fine as well, BUT only if I run it from home.

The laptop is the same laptop, and at home I can run it locally or from a share drive on the company's server through a vbn connection, from Home it works fine.

If I take the same laptop to work, the first form works fine. The second form does not retain the multi select highlights, and performes the functions only on the 1st record, gets to a certain point where the highlighted selections become un-highlighted, and finishes up thinking there was only ever one record selected.

It does this de-highlighting when it hits this portion of the code:

Set oDoc = oApp.Documents.Add(strTemplateName)

Again, no problem when I carry the laptop home and run it, no problem with the other almost identical form, and even more confusing, both forms work fine for a colleague at work on their laptop. "must be me"

Any ideas would be a tremendous help - I'm out of ideas.

Thanks




 
I'm not sure what your line of code is supposed to do out of context. Could it be that it is an error causing your data to not display?

Otherwise all these ideas are somewhat long shots...

Use the command line switch to remove all compiled code from your database. You will need to add your path names. You can execute the following from run on the start menu, command prompt or via a shortcut.

Code:
MsAccess.exe /decompile "YourDatabase.mdb"

Add the following line to the effected module...

Code:
Option Explicit

It forces all your variable names to be declared. Compliling after this may show undeclared variables (Access could be making bad assumptions about the variables).

Your problem may simply be the rendering of the display. Usually minimizing and maximizing has a tendency to fix onscreen rendering for the moment. You might try updating your video drivers. Since this is weird, no reason not to update all drivers and flash your bios if a firmware update is available.

Finally; an uninstall of Office, defrag and install of Office can't hurt either.
 
Lameid

I do already use an option explicit statement, but when you mentioned display resolutions a light bulb went on. That is the one specific difference I introduce between running at home versus at work - same laptop but 19" CRT versus 17" flat panel, and I set my screen resolutions differently. I'll also take a look at min/max settings, althought I did try changing modal and pop-up settings already. Drivers and bios are also good ideas I can look into - I did have bios and driver issues a year ago - so I know company practices for laptop configuration and maintenance are less than utopian. Thanks for the good ideas!
 
You might also look for monitor drivers from the manufacturer, at least for the work monitor, especially if it is the CRT.

You might also try working around the problem by turning off screen painting while it runs. The caveat here is that your error handler had better turn screen painting back on or you will have to end Access because you can't see what it is doing <I guess technically you could hit ctrl+G to get the immediate window, type the code and press enter to turn screen updates back on>. Personally I have only taking echo lines out of code because they annoy me during debugging.

Code:
Application.echo False 'Turn off Screen Painting
'code that does stuff here
Application.echo True 'Turn on screen Painting
 
Lameid

OK, problem solved. I tried changing screen resolutions without any luck, but then realized that at work I use an optical logitec mouse with a UBS transmitter. At home I use an omni box for two machines tied to a regular old standard HP wired mouse. Plugging my optical mouse into the laptop then lets me reproduce the problem. Unplugging it removes the problem. Unbelievable. Now I'll look for logitech driver updates and see what I can do, but at least I now know what the problem is. Thanks again for pointing me in the right direction.
 
Glad to help narrow it down.

If the driver update doesn't work, you might want to try making sure the laptops onboard pointer device (mouse) is disabled (touchpad or whatever that nub thing is called). Windows uses Vectors and adds them for pointers so you might have a fight going on between the two devices. Also updating your pointer drivers for your laptop or the of course Bios updates might also solve some wierdness.

Just for clarity, does it deselect the values or just not display it? If it is a display issue, an old standby comes to mind too... Ignore it :-D
 
Thanks lameid

The original problem was that it deselected the selections (mCount = 0)as well as the highlighted display. I did update the mouse driver, and that's all it ended up taking to fix the problem - it now works as intended.

Thanks for all the info and help. Hopefully the next poor soul who experiences this weird problem benefits from this post.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top