Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable\disable when EOF

Status
Not open for further replies.

mikeisvfp

Programmer
Mar 5, 2011
91
CA
I have created a right click menu, with items like new cust, edit and delete, i would like to disable edit and delete if the grid has no records, and enable when the user adds a record.
 
Did you create this with the menu designer? You can also create a menu in code, generating menu code via the menu designer gives you the code at hand, then you can not only use the SKIP FOR clause to SKIP FOR EOF(), but you can even just not generate that menu item at all, if at EOF().

Bye, Olaf.
 
Whether you created the menu in code or in the menu designer, your SKIP FOR clause should look something like this:

Code:
SKIP FOR RECCOUNT("MyAlias") = 0

That assumes the the cursor or table does not contain deleted records.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
thanks, would I put this in the refresh of the grid or of the form?
 
thanks, would I put this in the refresh of the grid or of the form?

Neither. The SKIP FOR clause is part of the menu. It's a clause of the DEFINE BAR command. You can also enter it into the menu designer, in the Prompt Options dialogue.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top