Alpha Video Training
Results 1 to 4 of 4

Thread: Menu Items

  1. #1
    Thomas Henkel
    Guest

    Default Menu Items

    I have a form with a custom menu. On the menu is an item "Display Photo". I do NOT want this optionavailable if the customer's key dowsn't exist in an IMAGE table. The image table is a cross reference to a folder of bitmap photos. When the form initially opens the menu item is grayed out as it should be. When I page down to the 2nd record, it remains gray even though I have a record in the IMAGE table. Mow here's the weird part. If I minimize the form, then maximize it, the item is active, as it should be. However if I again page down to the next customer (who doesn't have an image), the item stays active. If I again minimize then maximize, the item gray's out.

    Here is the logic for the item. If I go through and evaluate the expression, all looks OK, it is just on teh form that I have the problem.

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Menu Items

    Hi Tom,

    I don't know why the expression is not reevaluating when you change records and I *certainly* have no clue about the "weird part" but you could try the following:

    -attach code to create a flag (L:1) to the form's on_fetch event;
    -reference the flag variable in the menu item's enable expression.

    (Perhaps your problem results from a timing issue: the form fetching the next record before the expression has fully evaluated--not farfetched given it is a lookup.

    Bill

  3. #3
    Thomas Henkel
    Guest

    Default RE: Menu Items

    Thanks, Bill,

    I'll give it a shot on Monday.

    Tom

  4. #4
    Thomas Henkel
    Guest

    Default RE: Menu Items

    Bill,

    I took a little spin on your advise and added the following to the On_Fetch event.

    IF exist(client->SSN,"image","ssn")
    :Client_Reg.MenuItemEnable("Display Photo",.T.)
    else
    :Client_Reg.MenuItemEnable("Display Photo",.F.)
    END IF

    This works!!!!

    My problem is that the menu should be refreshed on each fetch without needing extra code. It seems to be missing the pass. Like I said, if you minimize, then maximize the form, the item properties are OK.

    Tom

    Bill, Could you e-mail me your e-mail address as my server doesn't seem to like what is listed if I doubleclick on your name on the Forum.

Similar Threads

  1. Reoccurring Items
    By Alan Sawyer in forum Alpha Five Version 6
    Replies: 2
    Last Post: 12-18-2004, 04:13 PM
  2. New Menu Items
    By crimmelcp in forum Alpha Five Version 5
    Replies: 5
    Last Post: 03-15-2004, 02:56 AM
  3. Calendar Add-in - missing menu items
    By Bill Griffin in forum Alpha Five Version 5
    Replies: 1
    Last Post: 07-08-2003, 06:39 AM
  4. Menus Items
    By Jerry Hartness in forum Alpha Five Version 4
    Replies: 2
    Last Post: 04-06-2001, 02:18 PM
  5. items disappearing from browse
    By Jeff Snyder in forum Alpha Five Version 4
    Replies: 5
    Last Post: 11-03-2000, 10:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •