>>Hi David, Here's what you wanted to look at. Thanks!
>>
>>The form is called from a command button on the main form and it is simply:
>>DO FORM search
>>
>>the search form is set to modeless,in screen and code below for methods.
>>
>>********************
>>ACTIVATE METHOD CODE
>>********************
>>DO search.mpr
>>IF USED('lcSearch')
>> IF RECCOUNT('lcSearch') = 0
>> STORE 0 TO lnnumrec
>> search.cmglnbutton2.command2.enabled = .F.
>> search.cmglnbutton2.command3.enabled = .F.
>> ELSE
>> LnNumrec = RECCOUNT('lcSearch')
>> search.cmglnbutton2.command2.enabled = .T.
>> search.cmglnbutton2.command3.enabled = .T.
>> ENDIF
>>ELSE
>> STORE 0 TO lnNumrec
>> search.cmglnbutton2.command2.enabled = .F.
>> search.cmglnbutton2.command3.enabled = .F.
>>ENDIF
>>search.txtLcstnumb.setfocus
>>
>>STORE '' TO lcfilter, lcwork, lcstnumb, lcstdir, lcstname, ;
>> lcparcel, lcownername, lclegaldes1
>>search.refresh()
>>
>>
>>
>>*******************
>>INIT METHOD CODE
>>*******************
>>
>>PRIVATE lnvalue, lcwork, ;
>> lcstnumb, lcstdir, lcstname,lcownername, ;
>> lclegaldes1, msg, lctemptable
>>
>>PUBLIC lnnumrec,lcfilter,lcparcel
>>
>>STORE '' TO lcfilter, lcwork, lcstnumb, lcstdir, lcstname, ;
>> lcparcel, lcownername, lclegaldes1
>>
>>LcThorough = 0
>>
>>ON KEY LABEL f3 search.cmglnbutton1.command1.click() && <> command
>>ON KEY LABEL f4 search.cmglnbutton1.command2.click() && <> command
>>
>>
>>*********************
>>REFRESH METHOD CODE
>>*********************
>>
>> IF USED('lcSearch')
>> IF RECCOUNT('LcSearch') = 0
>> search.cmglnbutton2.command2.enabled = .F.
>> search.cmglnbutton2.command3.enabled = .F.
>> ELSE
>> search.cmglnbutton2.command2.enabled = .T.
>> search.cmglnbutton2.command3.enabled = .T.
>> ENDIF
>> ENDIF
>>THISFORM.grdsrchresults.recordsource = ""
>>THISFORM.grdsrchresults.recordsource = "LcSearch"
>>THISFORM.grdsrchresults.recordsourceType = 1
>>
>
>There are some minor problems with this code, but they shouldn't make much harm. Anyway, try to start your form in more uniformed way, i.e. create custom property in main form, e.g. frmSearch and start search form with command
>DO FORM search NAME Mainform.frmSearch LINKED
>Doing you will make sure that scope is OK because you linked it to main form property. Also, you better use This or Thisform keywords in your INIT, ACTIVATE events (they are events not methods)
Thanks for stopping by Ed! I'm going to give that a shot right now. I'll let you know how it goes for me.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement