Microsoft KB Archive/100564: Difference between revisions
m (Text replacement - """ to """) |
m (Text replacement - "&" to "&") |
||
Line 41: | Line 41: | ||
<li>Create a push button that says "End Search Screen". Be sure that the variable you assign it doesn't match a field name.</li> | <li>Create a push button that says "End Search Screen". Be sure that the variable you assign it doesn't match a field name.</li> | ||
<li><p>In the VALID clause of the End Search Screen push button, input the following procedure: ''''''</p> | <li><p>In the VALID clause of the End Search Screen push button, input the following procedure: ''''''</p> | ||
<pre class="CODESAMP"> CLEAR READ & | <pre class="CODESAMP"> CLEAR READ && Terminate Screen </pre></li> | ||
<li>Double-click each field except the CNO field and select the Say and Refresh options. This enables all the fields to be displayed, but only the CNO field that is used to enter the customer number that will be searched for in the database may be edited.</li> | <li>Double-click each field except the CNO field and select the Say and Refresh options. This enables all the fields to be displayed, but only the CNO field that is used to enter the customer number that will be searched for in the database may be edited.</li> | ||
<li><p>In the VALID clause of the M.CNO field, input the following procedure: ''''''</p> | <li><p>In the VALID clause of the M.CNO field, input the following procedure: ''''''</p> | ||
<pre class="CODESAMP"> SEEK ALLTRIM(m.cno) & | <pre class="CODESAMP"> SEEK ALLTRIM(m.cno) && Find first CNO in the database equal to | ||
& | && M.CNO. | ||
*****IS THERE A RECORD WITH THIS CNO IN THE DATABASE? | *****IS THERE A RECORD WITH THIS CNO IN THE DATABASE? | ||
IF FOUND() & | IF FOUND() && If a record with the CNO exists, | ||
SCATTER MEMVAR & | SCATTER MEMVAR && read record into memory variables and | ||
SHOW GETS & | SHOW GETS && refresh the SAY fields that use the | ||
& | && memory variables. | ||
WAIT WINDOW 'PRESS TO SEE NEXT RECORD.' | WAIT WINDOW 'PRESS TO SEE NEXT RECORD.' | ||
*****CODE TO DEAL WITH MULTIPLE RECORDS WITH SAME CNO | *****CODE TO DEAL WITH MULTIPLE RECORDS WITH SAME CNO | ||
*****NUMBER | *****NUMBER | ||
SKIP 1 & | SKIP 1 && Skip to the next record. | ||
oldcno=m.cno | oldcno=m.cno | ||
SCATTER MEMVAR & | SCATTER MEMVAR && Get the new M.CNO. | ||
DO WHILE oldcno = m.cno & | DO WHILE oldcno = m.cno && Is the next record's CNO equal to | ||
& | && the previous? | ||
SHOW GETS & | SHOW GETS && Refresh the SAY fields with new | ||
& | && information. | ||
WAIT WINDOW 'PRESS RETURN FOR NEXT RECORD.' | WAIT WINDOW 'PRESS RETURN FOR NEXT RECORD.' | ||
SKIP 1 & | SKIP 1 && Go to the next record and repeat | ||
& | && same process until there are no | ||
& | && more records with the CNO number. | ||
oldcno=m.cno | oldcno=m.cno | ||
SCATTER MEMVAR | SCATTER MEMVAR | ||
ENDDO | ENDDO | ||
m.cno=oldcno & | m.cno=oldcno && Only show the old CNO number. | ||
WAIT WINDOW 'NO MORE RECORDS FOUND WITH CNO:'+oldcno | WAIT WINDOW 'NO MORE RECORDS FOUND WITH CNO:'+oldcno | ||
*****END OF CODE THAT IS NEEDED FOR MULTIPLE RECORDS***** | *****END OF CODE THAT IS NEEDED FOR MULTIPLE RECORDS***** | ||
RETURN & | RETURN && Return control to screen and don't | ||
& | && execute the code below. | ||
ENDIF | ENDIF | ||
Latest revision as of 12:24, 21 July 2020
The information in this article applies to:
SYMPTOMSYou can create a customized search screen by creating a quick screen with an End Search Screen push button, as illustrated in the example below.
MORE INFORMATIONThis example uses the CUSTOMER database located in the FoxPro TUTORIAL subdirectory and assumes that the database is indexed on and the order is set to the CNO field in the CUSTOMER database. In this screen, once a CNO number (customer number) is entered, the database will be searched for the corresponding record(s). The information in the record will be displayed, and you can press a key to move to the next record that has the same CNO number, if it exists. To quit, choose the End Search Screen button.
Additional query words: FoxWin FoxDos 2.x screen search locate function Keywords : kbcode FxenvMemory Version : 2.00 2.50 2.50a | 2.50 2.50a Platform : MS-DOS WINDOWS Issue type : |
Last Reviewed: August 23, 1999 |