code insisible not working (1 Viewer)

John thomas

Registered User.
Local time
Today, 13:14
Joined
Sep 4, 2012
Messages
206
I have a form that has a on click event t0 run code to make it inviisible but it will not work .I am using Access 2010
Option Compare Database
Option Explicit

Private Sub ok_Click()
Me.Visible = False
DoCmd.OpenQuery "show customers order", acViewNormal, acEdit
DoCmd.Close acForm, "show customer orders Form"
End Sub
 

John thomas

Registered User.
Local time
Today, 13:14
Joined
Sep 4, 2012
Messages
206
Hi Thanks for the reply
I am new to Access dont know what you mean by trusted locations
 

John thomas

Registered User.
Local time
Today, 13:14
Joined
Sep 4, 2012
Messages
206
Hi i have had a look at trusted locations seems a bit daunting .Why would this couse my prolem and what folders would i be looking for
 

John thomas

Registered User.
Local time
Today, 13:14
Joined
Sep 4, 2012
Messages
206
Thanks Rural Guy
I will try this tomorrow when I have tw..o computers on the go so I can follow the pictures .Is There something that access does not like about this code
 

RuralGuy

AWF VIP
Local time
Today, 14:14
Joined
Jul 2, 2005
Messages
13,825
Code does not work unless you are in a Trusted Location. It just takes 10 seconds to set. It is easy.
 

highandwild

Registered User.
Local time
Today, 21:14
Joined
Oct 30, 2009
Messages
435
If you are displaying the data in the query as it appears that you are then it would be better if you create a form to show the query results.
 

John thomas

Registered User.
Local time
Today, 13:14
Joined
Sep 4, 2012
Messages
206
Problem solved you were right rural guy
Thanks for your help and thanks to everyone else
John
 

RuralGuy

AWF VIP
Local time
Today, 14:14
Joined
Jul 2, 2005
Messages
13,825
Excellent! Thanks for posting back with your success.
 

Users who are viewing this thread

Top Bottom