>*____________________________________________________________________________________ >LOCAL lcType, lcKeyExp, lxValue, lcNearSet, lcOrder, lcField, lnFieldLen, llUpper > >llUpper = thisform.lKeyUpper && Upper case key search? >If not EMPTY( ORDER()) > lcType = ALLTRIM( TYPE( ORDER())) > lcKeyExp = ALLTRIM( KEY()) && Field name from which key derived > >* If the field is integer, there'll be just 4 bytes, but we may need to allow more digits >* than that, as numeric fields can hold in the millions. Don't know from the table what >* max length digits so just allow for 11 >* ______________________________________ > If lcType = "N" > lnFieldLen = 11 > Else > lnFieldLen = FSIZE( lcKeyExp) && How many chars/digs etc in key field > Endif > lcField = ALLTRIM( ALIAS()) + "." + lcKeyExp > lcCaption = DBGETPROP( lcField, "Field", "Caption") > DO FORM GoToDlog with lcType, lcCaption, lnFieldlen, llUpper to lxValue > lcNearSet = SET("NEAR") > Set Near on > If lcType = "C" > lxValue = ALLTRIM( lxValue) > EndIf > If not EMPTY( lxValue) && So if cancelled or null doesn't shoot to EOF > If not INDEXSEEK( lxValue, .T.) && If not found stay where you are > Wait WINDOW "Record not found in table" TIMEOUT 4 > EndIf > Endif > Set Near &lcNearSet > This.Parent.Refresh() >Endif >*____________________________________________________________________________________ >>
>*____________________________________________________________________________________ >LPARAMETERS tcType, tcCaption, tnMaxLength, tlUpper >LOCAL lnNoParams > >lnNoParams = PARAMETERS() >With Thisform > .cType = UPPER( tcType) > .lblField.Caption = tcCaption > With .txtField > If lnNoParams = 4 > If tlUpper > .Format = "!" > EndIf > Endif > If not EMPTY( tnMaxLength) > .MaxLength = tnMaxLength > Endif > DO CASE > Case Thisform.cType = "C" > Case Thisform.cType = "N" > .Format = "Z" > Case Thisform.cType = "D" > .Format = "DR" > .InputMask = "99-99-9999" > .DateFormat = 13 && system Short Date > EndCase > EndWith >EndWith >*____________________________________________________________________________________ >>