Solved

Setting "AllowByPassKey" in a Macro!

Posted on 1998-08-24
7
322 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 50 total points
ID: 1960082
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
combine ShipTo and BillTo Address 3 23
ms/access hyperlink/ftp 7 39
Storing Combo Box Selection in Table 12 45
Setting a DEFAULT value within a linked table 4 13
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now