I am using built in functions of MS Access which are working fine but first time when I applied some VBA codes for example display of messagebox or login password etc. it does not work when saved and re-open the database.
VBA working for new database but not when it is closed and re-opened
Collapse
X
-
You will have to provide more details.
Post the code, and where it is located. Also tell us which version of Access you are using. -
I m using Access 2007 and currently only the built in functions are working. Following code I have tried against a command button and it is working fine but after closing and opening it does not wor. I have checked the same in Windows XP and Windows 7 as well.
=============== =============== ===========
Option Compare Database
Private Sub Command0_Click( )
MsgBox "First VBA code test"
End Sub
=============== =============== ===========Comment
-
Access 2007 have much stricter macro security settings. Try to look for Trust center, inside Access. I dont often work in 2007, and can't remember the exact location but try the help file.Comment
-
No improvement has observed. I have tried many combinations in Access options but could not achieve the target. Trust centre help is also not useful. The only try I can do is to re-install office 2007 and then see. please let me know if any one knows specific location in trust centre to overcome this problem.
ThanksComment
-
Thank for the king response of every one. I have find out the soloution which was recommended by Mr. TheSmileOne and following is the path.
1-Open Access
2-Click on windows sign and select Access Options.
3-Click Trust Centre and then
4-Trust Centre Setting
5-Macro setting and then
6-Enable all macro.
Thank u every one for their kind support.
Best Regards.Comment
-
When you open a database with VBA code in it, you will get a Security Warning if it is not in a trusted location. Click Options..., Enable this Content, OK.
To set the location of the database so that it will be trusted, click Office Button, Access Options, Trust Center (Left), Trust Center Settings..., Trusted Locations.
If your permissions allow, check "Allow Trusted Locations on my network" if necessary, then Add new location, and select the folder where your database resides.Comment
Comment