Ben, (Claudine, Et Al.) I filed this one in my "Inbox\RBase\PotentiallyInterestingOrUseful" folder.
Later, Steve in Memphis ----- Original Message ----- From: "Ben Petersen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 21, 2002 3:47 AM Subject: A Duh Moment > This is one of those things I came across recently that had me > laughing at myself. Certainly nothing earth shaking, but one of > those simple things that helps a bit. > > I use choose a lot. I also use Bill D's tip for unions to add literal > choices to the menu... so forever I've been doing it like this: > > CHOOSE txtInvID FROM #VALUES FOR + > '* Add New Invoice',0 + > FROM Dummy WHERE LIMIT = 1+ > UNION + > SELECT '* Purchase on Account', -1 + > FROM Dummy WHERE LIMIT = 1 + > UNION + > SELECT '* Re-display by Name', -2 + > FROM Dummy WHERE LIMIT = 1 + > UNION + > SELECT DISTINCT(CTXT(T1.InvoiceNum)&T2.CusName),TranID > FROM ar_InvoiceVW T1, + > CusName T2 + > WHERE T1.CustomerID = T2.CusID AND + > T1.CustSrc = T2.CustSrc + > ORDER BY 1 AT 5,1 + > TITLE 'Press [Esc] to Quit' + > CAPTION Invoices + > LINES .vCT > > This example produces a menu with > > * Add new Invoice > * Purchase on Account > * Order by Name > [list of invoice#/CusName] > > But when my customers first start a system I don't want things like > "Order by Name" or "Purchase on Account" until there is > supporting data to allow a choice (if there are no invoices to sort or > customers with approved credit to choose why present the option?). > And so I would dutifully do counts and conditional stuff and end up > with an accurate menu 10 or 15 lines down the page. > > What never occurred to me was rather than selecting from my > Dummy table I should just base that particular select against the > table which holds the supporting data... if there is no data there is > no choice in the menu. > > So ... > UNION + > SELECT '* Re-display by Name',1 + > FROM ar_InvoiceVW WHERE LIMIT = 1 +... > > now is only included when there are invoices to address. > > Hope I didn't bore everybody with something this obvious! But > maybe there is some poor slob like me out there who can benefit > <g>. > > Ben Petersen > > > ================================================ > TO SEE MESSAGE POSTING GUIDELINES: > Send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: INTRO rbase-l > ================================================ > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: UNSUBSCRIBE rbase-l > ================================================ > TO SEARCH ARCHIVES: > http://www.mail-archive.com/rbase-l%40sonetmail.com/ ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
