From: NH Hiker NH on
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?
From: Daniel Pineault on
Have you ensured that the macro security is set to medium and that you
enabled them to run at the startup?
--
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"NH Hiker" wrote:

> 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?
From: Linq Adams via AccessMonster.com on
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)

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200806/1

From: NH Hiker on
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?

"Daniel Pineault" wrote:

> Have you ensured that the macro security is set to medium and that you
> enabled them to run at the startup?
> --
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "NH Hiker" wrote:
>
> > 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?
From: Pete D. on
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.

"NH Hiker" <NHHiker(a)discussions.microsoft.com> wrote in message
news:95E7F5C5-6911-4AE7-A7A1-9711CAB518B8(a)microsoft.com...
> 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?
>
> "Daniel Pineault" wrote:
>
>> Have you ensured that the macro security is set to medium and that you
>> enabled them to run at the startup?
>> --
>> Daniel Pineault
>> http://www.cardaconsultants.com/
>> For Access Tips and Examples: http://www.devhut.net
>> Please rate this post using the vote buttons if it was helpful.
>>
>>
>>
>> "NH Hiker" wrote:
>>
>> > 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?