473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VBA working for new database but not when it is closed and re-opened

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.
Sep 15 '10 #1

✓ answered by shrehman

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.

7 1400
TheSmileyCoder
2,322 Expert Mod 2GB
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.
Sep 15 '10 #2
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
=========================================
Sep 16 '10 #3
TheSmileyCoder
2,322 Expert Mod 2GB
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.
Sep 16 '10 #4
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.

Thanks
Sep 17 '10 #5
NeoPa
32,556 Expert Mod 16PB
I expect someone with the relevant experience will be along soon. I posted a call in the Access Help thread.

PS. If and when a solution is found will be the right time to set a Best Answer.
Sep 17 '10 #6
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.
Sep 17 '10 #7
ChipR
1,287 Expert 1GB
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.
Sep 17 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data...
1
by: ColinWard | last post by:
Is there a way to compact the current database when the user clicks the exit button. Alternatively, what is the command line switch to compact the database when the user opens the database? ...
1
by: Magnus | last post by:
I have created an application with VB in Visual Studio .Net. The application use a SQL server as database. Can anyone explain how I include the database when i make a setup for my application?...
8
by: mesut | last post by:
Mybe it's a stupid question but : I'm starting to learn VB.NET. I have some basic skills. I'm from Mainframe world and I have same question to make my DATABASES (tables and relation) I would like...
0
by: mabalsyed | last post by:
hai how to change the mdiparent label forecolor when close the mdichild from in vb.net2003
0
by: RAM | last post by:
Hi, (Sorry for my English...) I have such problem: if I use Database Explorer in Visual Studio I will not be able to connect from my application to the database; when I don't use Database...
12
by: Birky | last post by:
How can I stop a form from updating the database when a user closes the form? I have a form which is used for referencing, additions, and modifications but every time the form is closed with no...
1
by: dipankadia2007 | last post by:
when Close the form the msg comes on either click of "X" of any button the msg occurs if user said yes then only clos the form useing e thanx
10
by: loisk | last post by:
Hi, After our server 'wiped out' adversity by someone, we re-installed all the necessary mysql files. I am trying to separate my working database folder from the mysql program folder, and I want...
4
by: sujatha k | last post by:
I want to create one window service to synchronice my local database with server database.i've done the synchronization process in .net application it is working fine. i copied tat code and put it in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.