473,378 Members | 1,495 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,378 software developers and data experts.

A97 trying to set shortcutmenu=false for all forms

MLH
I would like to change ShortcutMenu property setting
to No for all forms - permanently. I tried this code...

Private Sub Command0_Click()
Dim frm As Form, ctl As Control

For Each frm In Forms
Debug.Print frm.Name
With frm
.ShortcutMenu = False
End With
Next frm
End Sub

Above code doesn't seem to be working. Only
a single formname is printed in debug window
(the current form in which this snippet resides).
After running the code, the property is set. How
can I save the setting permanently with all the
forms. Apparently, code is doing this only for
open forms.
Nov 13 '05 #1
4 1805
MLH wrote:
I would like to change ShortcutMenu property setting
to No for all forms - permanently. I tried this code...

Private Sub Command0_Click()
Dim frm As Form, ctl As Control

For Each frm In Forms
Debug.Print frm.Name
With frm
.ShortcutMenu = False
End With
Next frm
End Sub

Above code doesn't seem to be working. Only
a single formname is printed in debug window
(the current form in which this snippet resides).
After running the code, the property is set. How
can I save the setting permanently with all the
forms. Apparently, code is doing this only for
open forms.


Why not just disable the shortcut menus in the Startup properties?

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
MLH
That is DEFINITELY the ticket. Many thx.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Why not just disable the shortcut menus in the Startup properties?


Nov 13 '05 #3
On Fri, 07 Oct 2005 06:16:50 -0400, MLH <CR**@NorthState.net> wrote:
I would like to change ShortcutMenu property setting
to No for all forms - permanently. I tried this code...

Private Sub Command0_Click()
Dim frm As Form, ctl As Control

For Each frm In Forms
Debug.Print frm.Name
With frm
.ShortcutMenu = False
End With
Next frm
End Sub

Above code doesn't seem to be working. Only
a single formname is printed in debug window
(the current form in which this snippet resides).
After running the code, the property is set. How
can I save the setting permanently with all the
forms. Apparently, code is doing this only for
open forms.


Rick's suggestion is the obvious solution.
To answer why your code isn't working -

You are looping the forms collection which only contains the forms that are actually open at the time. To loop All forms
in the database you need to loop the forms CONTAINER.
Something like -

Dim I As Integer
Dim Db as Database

Set Db = CurrentDb()
For I = 0 To .Containers(1).Documents.Count - 1
DoCmd.OpenForm Db.Containers(1).Documents(I).Name, acDesign
Forms(Db.Containers(1).Documents(I).Name).Shortcut Menu = False
DoCmd.Close acForm, Db.Containers(1).Documents(I).Name, acSaveYes
Next

Set Db = Nothing
Nov 13 '05 #4
The Forms Collection only contains Open Forms. If you want to do a
programmatic operation on all Forms, start with the Forms Container, or use
the AllForms Collection. I also think, for permanently changing a Property,
you may have to open the Form in Design View, set the Property, then Close
the Form.

Larry Linson
Microsoft Access MVP

"MLH" <CR**@NorthState.net> wrote in message
news:l5********************************@4ax.com...
I would like to change ShortcutMenu property setting
to No for all forms - permanently. I tried this code...

Private Sub Command0_Click()
Dim frm As Form, ctl As Control

For Each frm In Forms
Debug.Print frm.Name
With frm
.ShortcutMenu = False
End With
Next frm
End Sub

Above code doesn't seem to be working. Only
a single formname is printed in debug window
(the current form in which this snippet resides).
After running the code, the property is set. How
can I save the setting permanently with all the
forms. Apparently, code is doing this only for
open forms.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gill Bates | last post by:
I'm trying to login to a banking site (https://www.providentconnection.com) using vb.net. I've tried many variations of WebClient and HttpWebRequest; none of which I've got to work. My latest...
2
by: Brainwave Surfer | last post by:
Am trying to grey out a field in a form depending on if there's a date in it or not, using access 2000, and i've tried vbscript and macros... I've read and tried and reread for a week... I'll be...
4
by: Bob | last post by:
Trying to repaint a form named fcon using a new filter: 'Repaint the form with the new data Forms!fcon.FilterOn = False Forms!fcon.Filter = "RecNo = " & currecno & " AND Currentvalue = -1"...
7
by: Bill Reed via AccessMonster.com | last post by:
I have a field called "Wiring" in a query which is boolean. If I place "True Or False" in the criteria for the field, I get all records (there are no nulls in the recordset). Likewise if I place...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
2
by: nate axtell | last post by:
I'm trying to create a custom DataGridBoolColumn. I inherit DataGridColumnStyle and create a public CheckBox variable. This columnType will be mapped to a dataTable boolean column. What are the...
2
by: baret bonden | last post by:
Trying to return a selected listbox item to another form .tried lots of ways; defining public variables and passing those as well as textboxes ..I' m able to display the chosen item on it's form...
2
by: Randall Parker | last post by:
Some questions on forms authentication: 1) Can one do one's own checking of username and password and totally bypass calling FormsAuthentication.Authenticate? 2) does the "new...
5
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.