Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution in VB
Message
De
26/10/1998 08:25:27
Jody Cairns
OAO Technology Solutions
Moncton, Nouveau-Brunswick, Canada
 
 
À
25/10/1998 11:40:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00150101
Message ID:
00150422
Vues:
24
I think I may have a solution for you.

Replace your line "&cForm..&cMenu..Visible = > &cForm..&cMenu..Visible = datPermission.Recordset("Allowed") " with

EnableMenu(cMenu, datPermission.Recordset("Allowed"))

Where EnabledMenu is the sub:

sub EnabledMenu(cMenu as string, bEnabled as boolean)
on error resume next
Me.Controls(cMenu).Enabled = bEnabled
end sub

Controls returns a collection of all the controls on your forms, including menu items. The On Error statement will allow the sub to ignore errors if the menu name is invalid.

hope that helps,

jody
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform