WayneBecker
Programmer
I used the following code in Clipper to seek a record in a Clipper data base. The three variables are from stamp collecting where you have a Back of the Book Code a Stamp Number and a variety. How to I get the following code to work from a Form where the collector would select a stamp to view. This would be used to a query the database the return the data to a form or a view.
@ 4,07 SAY" Search Screen For Catalogue Number"
?
?
* ? BACKBOOK
IF UPPER(BACKBOOK) = "Y"
ACCEPT " Enter Back of Book Code eg. 'J' : " TO BOBNO
ENDIF
?
?
ACCEPT " Enter Start Catalogue No.: " TO CATNO
?
CATNO = INT(VAL(CATNO))
IF CATNO = 0
@ 18, 12 SAY "Scott Number too SMALL, Please Try Again"
WAIT " "
LOOP
ENDIF
IF CATNO > 5000
@18,12 SAY " Scott Number too LARGE, Please Try Again"
WAIT " "
LOOP
ENDIF
IF LEN(TRIM(STR(CATNO))) = 0
@ 18,12 SAY "Scott Number Too SMALL, Please Try Again. "
WAIT ' '
LOOP
ENDIF
?
ACCEPT " Enter Variety: " TO VARNO
?
?
*Check to see if we are inputting data against a stamp we only want one number
IF CHOICE = 1
?
ELSE
SOME = "Y"
@16,12 SAY"Do You Wish More than One Scott Number? (Y/N)" GET SOME PICT "!"
READ
IF UPPER(SOME) = "Y"
@ 16,0 SAY " "
?
?
ACCEPT" Input Last Scott Number to Review. " TO LAST
LAST = INT(VAL(LAST))
ELSE
LAST = CATNO
ENDIF
IF (LAST < CATNO)
@ 21,0 say ""
ACCEPT " LAST Number Too Small Please Re-Input Here: " TO LAST
LAST = INT(VAL(LAST))
ENDIF
ENDIF
* Find Stamp in Database
IF LEN(TRIM(BOBNO))=0
BOBNO = " "
ENDIF
IF LEN(TRIM(BOBNO))=1
BOBNO = BOBNO + " "
ENDIF
SEEK BOBNO+STR(CATNO,7,0)+VARNO
Thanks in advance for all your help................Wayne
@ 4,07 SAY" Search Screen For Catalogue Number"
?
?
* ? BACKBOOK
IF UPPER(BACKBOOK) = "Y"
ACCEPT " Enter Back of Book Code eg. 'J' : " TO BOBNO
ENDIF
?
?
ACCEPT " Enter Start Catalogue No.: " TO CATNO
?
CATNO = INT(VAL(CATNO))
IF CATNO = 0
@ 18, 12 SAY "Scott Number too SMALL, Please Try Again"
WAIT " "
LOOP
ENDIF
IF CATNO > 5000
@18,12 SAY " Scott Number too LARGE, Please Try Again"
WAIT " "
LOOP
ENDIF
IF LEN(TRIM(STR(CATNO))) = 0
@ 18,12 SAY "Scott Number Too SMALL, Please Try Again. "
WAIT ' '
LOOP
ENDIF
?
ACCEPT " Enter Variety: " TO VARNO
?
?
*Check to see if we are inputting data against a stamp we only want one number
IF CHOICE = 1
?
ELSE
SOME = "Y"
@16,12 SAY"Do You Wish More than One Scott Number? (Y/N)" GET SOME PICT "!"
READ
IF UPPER(SOME) = "Y"
@ 16,0 SAY " "
?
?
ACCEPT" Input Last Scott Number to Review. " TO LAST
LAST = INT(VAL(LAST))
ELSE
LAST = CATNO
ENDIF
IF (LAST < CATNO)
@ 21,0 say ""
ACCEPT " LAST Number Too Small Please Re-Input Here: " TO LAST
LAST = INT(VAL(LAST))
ENDIF
ENDIF
* Find Stamp in Database
IF LEN(TRIM(BOBNO))=0
BOBNO = " "
ENDIF
IF LEN(TRIM(BOBNO))=1
BOBNO = BOBNO + " "
ENDIF
SEEK BOBNO+STR(CATNO,7,0)+VARNO
Thanks in advance for all your help................Wayne