Here's a Funny Thing

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:59
Joined
Sep 12, 2006
Messages
16,072
Here's a Funny Thing (Fixed)

On a server we have used subst command to map a users actual folder to a drive P;

subst P: path

-----------------
now, a normally working switchboard fails to work correctly in this environment. In particular the handlebuttonclick fails

This appears to work by filtering the recordset to the selected item, which then causes the current event to fire, and therefore refresh the displayed menupage to the newly selected menu.

Well the current event doesnt fire, but only when you run the code in
the subst drive. It fires normally when you run from the actual drive.

Anyone seen this before?

---------------
I tried on a normal XP machine, and the same thing happened, so it isnt the server thats the problem.


-----------------
not such a funny thnig

my bad, i think!

found the error.
 
Last edited:
I've mostly seen code not fire when the vba code needed to be debugged/compiled but that would seem weird since you've indicated (correct me if I'm wrong) that it's the same mdb being accessed, just accessed from a mapped drive. Let me re-state what you wrote - If accessed via a mapped drive, the OnCurrent event doesn't fire, otherwise it does for non-mapped drives?

I might first suspect it has something to do with the connection to any linked tables (if any) since you mentioned drive mapping and switchboard. Have you tried (just to test) putting all the tables into a test FE to make sure it's not connection to the table related if you're dealing with linked tables?

I might also try manually mapping the drive (to test) to see if the subst way is somehow affecting something (for any user). If manually mapping produces the same non-firing of code (again for any user), I might wonder if it's a network type issue affecting the code. If it's mapping limited to only 1 user, that at least helps troubleshoot something else that might be going on with a specific user account.

I'm usually not a fan of the switchboard, since it means a form (which the user typically keeps open or where I go to when closing other forms) that is bound to a table. I typically like to keep as many forms the user might 'sit' on unbound to any table. I'll even write unbound forms for data type forms where there's a slow connection.

Have you tried adding in a msgbox "OnCurrent Event fired" in the OnCurrent event of the form just to make sure that it's not firing on that event?

Other things to check:
1. References in the mdb.
2. Refreshing all linked tables.
3. A blank mdb (with no tables) on the mapped drive and putting code in a non-bound form in the OnCurrent event to see if it fires.
4. Putting the backend in a different location (to test)


That's all I can think of offhand but I'll try to post any other ideas as I think about this. Please let me know what you find. I'm curious about the solution or what the testing produced.
 
Please let me know what you find. I'm curious about the solution or what the testing produced.
<laughing up a storm> :D

You must not have recognized his edit from several hours ago:


gemma-the-husky said:
-----------------
not such a funny thnig

my bad, i think!

found the error.
 
Hey gemma-the-husky,

I just noticed your last sentence which said you found the error. What by chance was it?
 
Yeah. I just read his last sentence (laugh) after thinking about all the possibilities and wording my post the best way possible.

Now I'm really curious to what the solution was (since I had this site open along with a bunch of others.) Stress relief from work :)
 
ok, but its a bit mundane really

in the open event, what i was originally doing was testing the drive to ensure users could not run from a network drive. Because in this environment, they are now runnnig from the P drive, I needed to allow that particular drive.

all that happened was that i had coded this test incorrectly, and wasnt running all the launch code in the open event correctly, when users WERE running from the P drive.

after a lot of research, i eventually realised that one of the statements in the switchboard's open event is to set form filters TRUE - and I was bypassing this statement, because of my coding error, which didnt cause any run time error (actually just an exit sub in the wrong place!)

It was this that caused the problem


As I said, My bad.
 
Ha. Shoot - I was hoping for something more involved such as a drive mapping incorrectly, permissions, or other things.

Thanks for the reply.
 

Users who are viewing this thread

Back
Top Bottom