Well, I am not highly experienced in VB. I know that you can accomplish what you wish to do in VB; however, I am not sure of the exact code. I know that you should cycle through each menu option in the form's menu component. You can then compare that menu caption with the field name to disable/enable as necessary.
You should probably post the example below to a VB forum to get a clear example from a VB programmer...
Regards,
Jack
>I want to disable the menus of the form i am loading depending on the permissions given to the user. I want to do it the following way, this is VB code:
>
>datPermission.Recordset.MoveFirst
>cFind = "UserID = '" & cID & "' and FormName = '" & Screen.Activeform.Name
>cForm = Screen.Activeform.Name
>
>datPermission.Recordset.FindFirst cFind
>Do While Not datPermission.Recordset.EOF
>' Here is why i want to do macro substitution:
> cMenu = datPermission.Recordset("MenuName")
>
> 'FoxPro code would look like this. How do I do it in VB
> &cForm..&cMenu..Visible = datPermission.Recordset("Allowed")
> datPermission.Recordset.FindNext cFind
>Loop
>
>I would really appriciate your help
>
>Thanks
>Abdul Ahad
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only