Trying to use my database on a different pc

N

NH Hiker

I have an Access 2007 database that works fine on my Vista pc. When I copy
the database to an XP machine with Access 2007, the database opens fine. All
the access forms, table, etc work, macros work, but it appears that the VB
code doesn't execute. I don't get any error messages!!

eg. This code works fine on my machine, but doesn't execute on the other
machine. Again no error messages!

Private Sub txtHomePhone_GotFocus()

'sets the cursor to the beginning of the local exchange - after the area code
If Len(txtHomePhone) Then
Me.txtHomePhone.SelStart = Len(Me.txtHomePhone)
Else: Me.txtHomePhone.SelStart = 1
End If

End Sub

This is probably a newbie issue. Can anyone point me in the right direction?
 
D

Daniel Pineault

Have you ensured that the macro security is set to medium and that you
enabled them to run at the startup?
 
L

Linq Adams via AccessMonster.com

In version 2007, when no VBA code executes, the problem is that the folder
holding the database hasn’t been designated as a “trusted†location.

To trust your folder, click:
* Office Button (top left)
* Access Options (bottom of dialog)
* Trust Center (left)
* Trust Center Settings (button)
* Trusted Locations (left)
* Add new location (button)
 
N

NH Hiker

Thanks, I'll check that out on the other PC. I was able to replicate the
situation on PC that works, by changing the security level to "Disable all
macros with notification". So it's a real good possibility.

What i don't understand is why i don't get some sort of warning. Is there a
way to enable my code without choosing "Enable all macros"?

Also, and this may be related, how do I enable my code to run at startup?
 
P

Pete D.

This is done by the option Never Show Information about Blocked Content
within the trust center under Message Bar. I have had this happen on
systems that have run different versions of access datafiles on one machine.
When setting is on no warnings are generated and it is by design.
 
N

NH-Hiker

Thanks, I tried to recreate that on the pc that works, but the code still
executed - wierd. I'll try it on the other pc today and see what happens.
 
N

NH-Hiker

I take that back, seems that I needed to close access for the trust settings
to apply. So I was able to recreate the situation on the pc that was working
fire. I'll do the same on the other pc this afternoon. Thanks for the help!!
 
Top