Hi Tracy

I am creating an SQL select depending upon values of two sets of Radio
buttons on of which select which table to get the data from and the
other a filter upon the data as to whether there is a phone no. or an
email address

************************************************************************
**************************************
Select TempPhoneNo
Zap

lcFilterText = "Select "

Do Case
        Case ThisForm.optPhoneNos.Value = 1
                Select Member
                lcTable = "Member"
                lcPhone = "Member.phoneno"
                lcFilterText = lcFilterText + "Proper(Member.FullName),
Member.phoneno, Proper(Member.addr1)," + ;
                                "Proper(Member.addr2),
Proper(Member.addr3), Proper(Member.addr4), Upper(Member.postcode)," + ;
                                "Lower(Member.email),
Proper(Member.Surname) From Member Where " 
        Case ThisForm.optPhoneNos.Value = 2
                Select Committe
                lcTable = "Committe"
                lcPhone = "Committe.phone"
                lcFilterText = lcFilterText + "Proper(Committe.Name),
Committe.phone, Proper(Committe.addr1)," + ;
                                "Proper(Committe.addr2),
Proper(Committe.addr3), Proper(Committe.addr4),
Upper(Committe.postcode)," +;
                                "Lower(Committe.email),
Proper(Committe.Surname) From Committe Where "
        Case ThisForm.optPhoneNos.Value = 3
                Select NEC
                lcTable = "NEC"
                lcPhone = "NEC.phone"
                lcFilterText = lcFilterText + "Proper(NEC.Name),
NEC.phone, Proper(NEC.addr1)," + ;
                                "Proper(NEC.addr2), Proper(NEC.addr3),
Proper(NEC.addr4), Upper(NEC.postcode)," +;
                                " Nec.Title, Proper(NEC.Surname) From
NEC Where "
        Case ThisForm.optPhoneNos.Value = 4
                Select PrivateNos
                lcTable = "PrivateNos"
                lcPhone = "PrivateNos.phone"
                lcFilterText = lcFilterText + "Proper(PrivateNos.Name),
PrivateNos.phone, Proper(PrivateNos.addr1)," + ;
                                "Proper(PrivateNos.addr2),
Proper(PrivateNos.addr3), Proper(PrivateNos.addr4),
Upper(PrivateNos.postcode)," +;
                                " '', Proper(PrivateNos.Name) From
PrivateNos Where "
EndCase

Do Case
        Case ThisForm.OptPhoneNos.Value = 1
                ThisForm.optFilter.Enabled = .T.
                Do Case
                        Case Thisform.optFilter.Value = 1
                                        lcFilterText = lcFilterText +
"Left(" + lcTable + ".surname,1)"
                        Case Thisform.optFilter.Value = 2
                                        lcFilterText = lcFilterText +
"!Empty(" + lcPhone + ") .And. Left(" + lcTable + ".surname,1)"
                        Case Thisform.optFilter.Value = 3
                                        lcFilterText = lcFilterText +
"!Empty(" + lcTable + ".email)  .And. Left(" + lcTable + ".surname,1)"
                        Case Thisform.optFilter.Value = 4
                                        lcFilterText = lcFilterText +
"!!Empty(" + lcPhone + ") .And. Left(" + lcTable + ".surname,1) =
lcCaption " + ;
                                        ".Or.  !Empty(" + lcTable +
".email)        .And. Left(" + lcTable + ".Surname,1)"
                Endcase
        Case ThisForm.OptPhoneNos.Value = 2 .Or.
ThisForm.OptPhoneNos.Value = 3
                lcFilterText = lcFilterText + "Left(" + lcTable +
".surname,1)"
                ThisForm.optFilter.Enabled = .F.
        Case ThisForm.OptPhoneNos.Value = 4
                lcFilterText = lcFilterText + "Left(" + lcTable +
".Name,1)"
                ThisForm.optFilter.Enabled = .F.
EndCase

lcFilterText = lcFilterText + " = lcCaption Into Cursor TempPhoneNo
Readwrite "

&lcFilterText
************************************************************************
**************************************
I run the macro which then produces a cursor with the fields EXP_1 etc

The grid is bound to the cursor so I have to reset the Headers and the
column widths etc.

The grid then show the Details who are either Members, Committee
Members, N.E.C. Members or Private telephone No's

There are no other Right Click events coded.

Cheers

Peter



-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Tracy Pearson
Sent: 08 September 2010 21:16
To: [email protected]
Subject: RE: Right click memus in grids

Peter Hart wrote on 2010-09-08: 
> Hi Folks
> 
> I have a grid on a pageframe  which I want to copy the details of the 
> current record to the Clipboard.
> 
> I have create a short cut menu and generated it.
> 
> In the Right Click of the first columns text box I have place the code
> 
> Do sctCopyToClipboard.mpr
> 
> Nothing happens when you right click.
> 
> It doesn't happen if you put it in the Right click of the Grid or any 
> of the other columns text box's.
> 
> I have a breakpoint on each line of code and the Right click does not 
> appear to be activated.
> 
> I have also tried all combination of read only and enabled
> 
> Any Ideas
> 
> Peter
> 
> Peter Hart Computers
> 

Peter,

If the grid is not editable, set the AllowCellSelection = .F. then call
the code from the grids RightClick event.

Otherwise, are you adding the column via code?

Tracy Pearson
PowerChurch Software




[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/a57fa4cf19531343a2ee11b57db8e3af100...@server.peterhartcomputers.local
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to