Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
VB not working on other PCs
Brad Bogle 
    
5 years ago
Maybe this is a problem that has already been addressed but I can't find the answer. Our office is using the Office 365 version of Access with our backend tables being hosted on SharePoint. When I update the frontend file, I will save ACCDE copies and send them to everyone in the office. This has worked fine for months until I started adding some VB code to the file. The files I send out will still work but the code is disabled for them. Those ACCDE copies work fine on my PC but not their's. I have checked for empty subs and cleaned them out and set trusted locations on their stations but the code is still disabled for them. Anyone have some advice? Thanks in advance
Adam Schwanz  @Reply  
           
5 years ago
If you're 100% sure the trusted location is correct, did you try compiling the code/compact and repairing before pushing out the ACCDEs? I have 0 experience with Access+SharePoint but it wouldn't surprise me if this was another fun benefit of it.
Brad Bogle OP  @Reply  
    
5 years ago
Yes, and the interesting thing is that my code will work on their PC's in ACCDB format. Just not in ACCDE format
Richard Rost  @Reply  
          
5 years ago
Are you using any late binding? If so, there could be an error in your code that COMPILES, but doesn't work, and that might cause an ACCDE problems.
Brad Bogle OP  @Reply  
    
5 years ago
The ACCDE files work on my PC, just not others. I'm not certain about the late binding. I'm in Developer 3 so I'm trying to stay within my skill levels. Basically, I've created two Private Subs and assigned them to various Double-Click events in two different forms. And I added two DLookUp statements to the After Update events in a couple other fields. If you like, I can show you the code but it's very simple. I haven't done anything complicated at all.
Richard Rost  @Reply  
          
5 years ago
Ok. That's weird. Try this: make a blank new database. Put one form in it with a command button that just MsgBoxes something. Make an ACCDE. Now try that on the machines that aren't working. That will likely tell us if it's a problem with ACCESS and not just your database.
Brad Bogle OP  @Reply  
    
5 years ago
Hey Richard, I posted this on an Access Facebook forum and a guy told me to try writing my DLookUp statements like:
txtOrganization = DLookUp("OrganizationID","DonorT","DonorID=" & Me.DonorID & "")

This worked. Now the ACCDE files work on everyone's workstations. I wanted to report this back in case anyone else ever has this same problem
Richard Rost  @Reply  
          
5 years ago
How were you writing it before? What's the difference? The addition of "Me."?
Brad Bogle OP  @Reply  
    
5 years ago
I was writing it as
txtOrganization = DLookUp("OrganizationID","DonorT","DonorID=" & DonorID)
Richard Rost  @Reply  
          
5 years ago
So you're saying the addition of Me. made a difference? It shouldn't, logically. The extra "" at the end is meaningless too (it's an empty string). Very strange. I'm curious if this works:

txtOrganization = DLookUp("OrganizationID","DonorT","DonorID=" & Me!DonorID)

or this:

txtOrganization = DLookUp("OrganizationID","DonorT","DonorID=" & Forms!FormName!DonorID)
Brad Bogle OP  @Reply  
    
5 years ago
So, I just tried both of those out on my PC.

"Me!DonorID" came up blank

"Forms!TestF!DonorID" also came up blank
Richard Rost  @Reply  
          
5 years ago
But Me.DonorID works? That's crazy. I've NEVER seen that kind of behavior before.
Adam Schwanz  @Reply  
           
5 years ago
Out of curiosity, is this a number field or a string (short text)?

Does txtOrganization = DLookUp("OrganizationID","DonorT","DonorID=""" & Me!DonorID & """") work?
Brad Bogle OP  @Reply  
    
5 years ago
Adam, these are foreign key fields pulling from their respective tables. And no, the "!" does not seem to work in the VB code. At least not for DLookUp(). It works in the Query designer and the default value properties.

Richard, I agree that it's very strange. Your examples always work in my practice DB's but our company DB is the only one being hosted on SharePoint. That's the only difference in all of them. A lot of strange things happened when I uploaded my tables to SP but so far this is the only thing that has caused something not to work. I made the mistake of not deleting my relationships before uploading and it ended up making several copies of each related table in SP. That was something I didn't expect and SP added a whole bunch of fields to my tables that I can only assume are for the purposes of tracking users. It really cluttered things up
Richard Rost  @Reply  
          
5 years ago
Are you using a passthru query to Sharepoint?
Brad Bogle OP  @Reply  
    
5 years ago
No, after I uploaded to SP everything operated the same as before I split the DB except for the fact that it took a little longer to retrieve data and auto numbers didn't assign until you save the record. I haven't used a passthru query but I know that update queries work fine. I've run them several times. I've been able to do everything exactly as I've learned from your classes until this little problem with VB not working in encrypted files on other computers. That one little difference in the DLookUp disabled all of the code. Even the stuff that wasn't related to it.
Richard Rost  @Reply  
          
5 years ago
Are you signing the user in? See this thread at Microsoft.

I see a couple other issues in Google search results too.
Brad Bogle OP  @Reply  
    
5 years ago
Everyone in the company has an Office 365 license with the full version of Access. I grant them full read/write/edit permissions in SharePoint. When I distribute the DB files, I will create an ACCDE copy for each person in the office. I do some minor customization for each person. Nothing major, each has a different form on startup, hide the navigation window, and disable full menus. Then I will zip the copy and email it. Because the SP link is already established, I don't even have to re-link tables for them. They just unzip the file and start using it. It has been working great. We really haven't had any other issues besides this.
Richard Rost  @Reply  
          
5 years ago
That's so weird. Never seen that before, and I've been teaching and building custom databases for almost 30 years.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 1:49:21 PM. PLT: 0s