VBA not working on shared database

rachel_harder

Registered User.
Local time
Today, 14:14
Joined
Feb 4, 2015
Messages
13
I have a Database that I have built and have put onto a shared network so my coworkers can use the same database we all can track things from our own computers. The database has a form that can open different forms depending on the button that is pushed on the form. When I test everything out on my computer everything works great, and I have no issues. I then go to a coworkers computer, and I try to click on some buttons, and nothing happens. I then go back to my computer, and click on the button, and everything works great. The code that I am using to operate the buttons is really simple, and I have tried multiple different ways of writing it. All the codes work on my computer but don't work when on a coworkers. An example of the code I am using is:
Code:
Private Sub Search_Button_Click()

DoCmd.Minimize

str_Form = "Admin_PartSearch"

DoCmd.OpenForm str_Form, acViewNormal, acEdit

End Sub

Is there anything that I am doing wrong so that the code will not work on my coworkers computers?

Thank you for your help
 
Is the database split with a front end on each user's computer & a shared backend on the network.

If yes - check the table links are all correct

If no - STOP and split the database as a matter of urgency.
If you don't do this it will get corrupted as soon as more than one person uses it at once
 
Last edited:
Hello Ridders,

I do have the database split, and all the links to my tables are working fine on my computer. I just can't seem to find a reason as to why it will only work on my computer and not on any of my coworkers.
 
OK obviously I'm working in the dark here so all I can do is suggest things to check:

1. Are the drive letters for the BE path the same for other users as for yourself?
2. Do other users have read/write access to the folder where the BE is stored?
3. Do other users have the same version of Access as you?
4. Are there any missing VBA references?
5. Are the table links OK on other PCs?
6. Have you tried compiling, compacting, decompiling, recompiling, recompacting?

It sounds like the db does actually open on other PCs so:
7. If you open the db on their PCs, does the open form code work for you?
8. ???

I'm sure more things to check will come to me (& other forum users) but that's something to get you started

And as I'm sure you're already doing, google for other ideas online.

If you solve it yourself, please post the explanation for the benefit of others
 
Last edited:
to add to ridders list

is the front end on each users machine in a trusted location?
have the users enabled the code?
 
addition,

on your database use Link Table Manager.
select all your linked tables.
enable also Always prompt for new location.
select OK.

when your on "Select New Location" window, type your network address on the File name textbox, ie:

\\SharedComputerName\SharedFolderName\BackEndName.accdb

or

\\192.168.1.20(shared computer ip)\SharedFolderName\BackEndName.accdb
 
Ridders,
I have looked at all the issues you have stated multiple times and as near as I can tell everything looks right. I have even tried rewriting the code from a coworkers computer and that still did not work. I would then come back to my computer, and the rewritten code that I did on the coworkers computer works like a charm.

CJ_London,
I have checked the coworkers computer and they are all saving the front end on there desktop so they have easy access to the db. I have had them access the front end when it is on the same shared network that the back end is on to see if it would work then. The same issue is still there.

arnelgp,
I have done what you have suggested and that has not helped my issue.


I don't think the issue is with the front end talking to the back end because:

I have had to set the db up so my less then computer savvy coworkers can use it also. So on start up of the db a form opens and it has a list of buttons that when pushed will bring up different forms. the different forms are used to enter new information, enter info into queries and then to make a report from the queries that can be emailed or printed. All of the forms that need to open when the respective button is pushed are on the front end. All of the buttons except one work on all of our computers. I have rechecked the code on all of the buttons and everything is the same except for what form needs to be opened for the corresponding button, and I have made sure that is correct.

So I have 7 buttons that are on the start up form and 6 out of the 7 buttons work on every ones computer but the 7th button will only work on mine. :banghead:

Thank you to every one again for trying to help me with this issue.
 
One further thought related to file location.

I wouldn't use the desktop for a db as
a) the file could get very large and slow down users' computers
b) the path is different for each user & in theory permissions could vary

You didn't say whether you are running it from the desktop.

Try installing the db to the same specified folder on each user's computer.
Use a script to ensure permissions are set correctly for FE for everybody
(and for BE if not already done).

More thoughts
1. 32bit/64 bit Access? Same Windows version?

2. Try closing the current form rather than minimising it before the other form is opened

3. Try creating a new copy of the form users can't open in case its corrupted

4. Finally try creating a new clean db & importing everything into it.

If it still doesn't work after that, you could try uploading a stripped down copy of both FE & BE with just the relevant bits and one of us could try running it to see what happens!
 
Ridders,
You sparked my memory
More thoughts
1. 32bit/64 bit Access? Same Windows version?

We are working with 32 bit Access 2016. We are all running windows 7. The db was originally made using Access 2010 I just don't know the bit of it, but I would assume 32 also:confused:.

Then my company did a company wide update to windows 2016 just a couple of months ago. Before the update I was the one that had to use that button 99% of the time and it worked. Then when the update happened I got rotated to a new position that doesn't need to use that button any longer. So I don't know if the issue was there before the update or not because two things happened at the same time.
 
Code:
DoCmd.OpenForm str_Form, acViewNormal, acEdit

just a thought

the openform method uses acNormal, not acViewNormal, and acFormEdit, not acEdit. At least according to intellisense.
the openreport method uses acViewNormal and i dont believe it has an edit argument.
although with a quick test it does not seem to make a difference.
 
Hi Moke

Sometimes we miss the most obvious things ...
However I just tested this code & the form still opened normally
 
Sorry rachel - missed this reply in a flurry of responses from various posts

We are working with 32 bit Access 2016. We are all running windows 7. The db was originally made using Access 2010 I just don't know the bit of it, but I would assume 32 also.

Almost certainly 32 bit or issues would have arisen
As you can see from my signature line, I have all the following:
Access 2010 32-bit, Access 2016 32-bit & 64-bit
so if I can help by testing it , let me know
 
So I finally got everything working!!! I don't understand why it works now but it is. I just deleted the button that was not working and deleted the form it was supposed to open. I then remade the form and button and then put the same code I was using on the button to open the form. Now everyone on the shared network is able to make all of the buttons work.

So again I have no idea why I was the only one able to make everything work before and why everyone is now able make everything work. So right now I am going to see how long it takes before the issue shows up again.

Thanks everyone for helping me out :D
 

Users who are viewing this thread

Back
Top Bottom