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!

Trouble with append from

Status
Not open for further replies.

TGrahmann

Programmer
Feb 19, 2015
43
US
Does anybody see any problem with this code?

APPEND FROM cPath+"Filledform.db" where filledform.fid=nFide AND LIKE(ALLTRIM(filledform.a1), ALLTRIM(thisform.text1.Value)) AND LIKE(ALLTRIM(filledform.a2), ALLTRIM(thisform.text2.Value)) AND LIKE(ALLTRIM(filledform.a3), ALLTRIM(thisform.text3.Value)) AND LIKE(ALLTRIM(filledform.a4), ALLTRIM(thisform.text4.Value)) AND LIKE(ALLTRIM(filledform.a5), ALLTRIM(thisform.text5.Value)) AND LIKE(ALLTRIM(filledform.a6), ALLTRIM(thisform.text6.Value)) AND LIKE(ALLTRIM(filledform.a7), ALLTRIM(thisform.text7.Value)) AND LIKE(ALLTRIM(filledform.a8), ALLTRIM(thisform.text8.Value)) AND LIKE(ALLTRIM(filledform.a9), ALLTRIM(thisform.text9.Value)) AND LIKE(ALLTRIM(filledform.a10), ALLTRIM(thisform.text10.Value)) AND LIKE(ALLTRIM(filledform.a11), ALLTRIM(thisform.text11.Value)) AND LIKE(ALLTRIM(filledform.a12), ALLTRIM(thisform.text12.Value)) AND LIKE(ALLTRIM(filledform.a13), ALLTRIM(thisform.text13.Value)) AND LIKE(ALLTRIM(filledform.a14), ALLTRIM(thisform.text14.Value)) AND **FoxPro IDE puts a line break here ** LIKE(ALLTRIM(filledform.a15), ALLTRIM(thisform.text15.Value)) AND LIKE(ALLTRIM(filledform.a16), ALLTRIM(thisform.text16.Value)) and LIKE(ALLTRIM(filledform.a17), ALLTRIM(thisform.text17.Value)) and LIKE(ALLTRIM(filledform.a18), ALLTRIM(thisform.text18.Value)) and LIKE(ALLTRIM(filledform.a19), ALLTRIM(thisform.text19.Value)) and LIKE(ALLTRIM(filledform.a20), ALLTRIM(thisform.text20.Value))
REPORT FORM BatchForm to PRINTER
 
APPEND FROM is a xBase command. In this case the condition is written using the "FOR" keyword.
The "WHERE" keyword is used by SQL phrases.


Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
I have fixed this issue with a "SELECT * FROM
WHERE [conditions] INTO TABLE [other_table]"
Thank you very much, Vilhelm!
 
Followup:
The append statement works now, but if THISFORM.TEXTx.VALUE="*", the LIKE() functions are not grabbing the data with the wildcard. any ideas?
 
The wildcard characters operate in the first expression in a LIKE(). You are using them in the second expression.

In other words:

Code:
LIKE("Some text", "*")    && returns .F.
LIKE("*", "Some text")    && returns .T.

Just swap round the two parameters in your LIKE()s, and it should work as expected.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top