?
Solved

Setting "AllowByPassKey" in a Macro!

Posted on 1998-08-24
7
Medium Priority
?
361 Views
Last Modified: 2008-02-01
Hi,

How can I set the "AllowByPassKey" in a macro?

Setting it like [Databases]![Mydatabase]![Allowbypasskey] does not work, as Access does not recognize [databases] as a collection (like forms, etc...)

Greetings,

   os
0
Comment
Question by:os012897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 5

Expert Comment

by:cekman
ID: 1960076
create a function to do what you want - then call the function from the macro using the runcode command from the macro.

Hope this helps
CEKMAN
0
 
LVL 3

Author Comment

by:os012897
ID: 1960077
So there is no way to set it directly?

os

0
 
LVL 5

Expert Comment

by:cekman
ID: 1960078
I don't know of one - but feel free to reopen the question - I can always repost my original answer if you don't find a better solution.

Good Luck
CEKMAN
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:os012897
ID: 1960079
Hi CEKMAN,

Yeah, lets do it that way :)!

Thanx for your answer anyways.

Greetings,

        os

0
 

Expert Comment

by:eugeneo
ID: 1960080
That's the only way to do it as far as I know:

Dim db As Database
Set db = DBEngine.Workspaces(0).Databases(0)
Dim pr As Property
Set pr = db.CreateProperty("AllowByPassKey", dbBoolean, False) 'Or True, depending on what you need
db.Properties.Append pr
'This will not always work (e.g. if property already exists)
'For more info see Help under "AllowBypassKey", then select "Example"

0
 
LVL 3

Author Comment

by:os012897
ID: 1960081
Hi eugeneo's!

Thanx for your reply! It is basically (though more elaborated) what cekman proposed .... as he was first I will give him the points! Appreciated your answer anyways.

TO Cekman:

Post a reply and you get them points!

Greetings,

      os

0
 
LVL 5

Accepted Solution

by:
cekman earned 150 total points
ID: 1960082
Thanks!
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question