Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Setting "AllowByPassKey" in a Macro!

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
os012897
Asked:
os012897
  • 3
  • 3
1 Solution
 
cekmanCommented:
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
 
os012897Author Commented:
So there is no way to set it directly?

os

0
 
cekmanCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
os012897Author Commented:
Hi CEKMAN,

Yeah, lets do it that way :)!

Thanx for your answer anyways.

Greetings,

        os

0
 
eugeneoCommented:
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
 
os012897Author Commented:
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
 
cekmanCommented:
Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now