Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the information from table (.dbf) display in the form

Status
Not open for further replies.

millbear

Programmer
May 16, 2002
23
SG
Hi all

I purely have no idea where i go wrong. I'm trying to get the datas (such as CHEVSINSMZ 100,CHEVSINSMZ 100, CHEVSINSMZ 101, CHEVSINSMZ 102, etc) from the table (.dbf) display and then trim into "CHEVSINSMZ 100 & 101 & 102 itself. [upsidedown]

_-_-_-__-_-_-__-_-_-__-_-_-__-_-_-__-_-_-__-_-_-__-_-_-_

tnfjob is the name of the table. Jt_hblno is an attribute of the table (.dbf)in the form. It is like something that originally contains CHEVSINSMZ 100,CHEVSINSMZ 100, CHEVSINSMZ 101, CHEVSINSMZ 102, etc in the column...


Code:
LOCAL InputString, CommaPos, i, SpacePos, PrefixString, BlNo

select j
? select ()

STORE 0 TO CommaPos, i, Counter, SpacePos
LOCAL ARRAY xAr[1]
xAr[1] = ""
PrefixString = ""
BlNo = ""
InputString= "Jt_hblno"  ** <-- Problem with this part
CommaPos = AT(",",InputString)
SpacePos = AT(" ", InputString)
PrefixString = SUBSTR(InputString, 1, SpacePos - 1)
DO WHILE CommaPos > 0
    Counter = Counter + 1
    BlNo = STRTRAN(SUBSTR(InputString,1, CommaPos-1), PrefixString, "")
    IF ASCAN(xAr, BlNo) = 0
        i = i + 1
        DIMENSION xAr[i]
        xAr[i] = BlNo
    ENDIF 
    InputString = ALLTRIM(SUBSTR(InputString,CommaPos+1))
    CommaPos = AT(",",InputString)
ENDDO
BlNo = STRTRAN(InputString, PrefixString, "")
IF ASCAN(xAr, BlNo) = 0
    DIMENSION xAr[i+1]
    xAr[i+1] = ALLTRIM(BlNo)
    Counter = Counter + 1
ENDIF
OutPutString = "("+ALLTRIM(str(Counter))+") " + PrefixString + " "
FOR j = 1 TO ALEN(xAr)
    IF j = 1
        OutPutSTring = OutPutSTring + xAr[j]
    ELSE
        OutPutSTring = OutPutSTring + " & " + xAr[j]
    ENDIF
NEXT j


.xdf_bl.value= OutPutSTring  ** Display the information on the form

When I tested out the form by calling any job no (in yellow box of JOB NO), all the datas will be displayed. But I have a problem with this part (image displayed below)
invoice1.JPG
 
Haven't checked the logic of your reformatting code, but this line:
Code:
InputString= "Jt_hblno"
should probably be
Code:
InputString= Jt_hblno
if you want the contents of the field.

Regards,
Jim
 
[thumbsup] jim for this code.
When I key in any job no (in yellow field), the data on B/L no is displayed. But the problem is ... that it cannot displayed again when i keyed in another few more job nos..

Wondering why... [ponder]

Thanks
millbear

Just a Beginner! Need help badly.
 
Do you refresh the form after entering a new job number?

Regards,
Jim
 
Jim

Yes, I did refresh it.



Thanks
millbear

Just a Beginner! Need help badly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top