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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stupid Error?!

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
US
Thank you again everyone for all there help from my question from before.. I've got another one..

Here's the code in all it's 'glory'.. the issue is that it's NOT updating the table with the string information.. and therefore print blank reports...

I've got gotton so fusterated that this simple code isn't working.. I'm assumeing is just a dumb error that I'm overlooking.....

BTW, this is in VFP 3.0 in case it matters.. =)

=========CODE===============


&&INIT
&&&&&&&&&&&&&&&&&&&&&
Batch = ""
Work = ""
Policy = ""
Company = ""
SSN = ""
System = ""
WorkNum = ""
DocType = ""
SBU = ""

&&Check Input from Option Buttons
IF ThisForm.Batch.Value = 1 then
Batch = "Foo"
Work = "Foobar"
Else
Batch = "Foo2"
Work = "FOobar2"
ENDIF

Policy = "XXXBLANK"
Company = "XXXBLANK"
SSN = "XXXBLANK"
System = "XXXBLANK"
WorkNum = "XXXBLANK"
DocType = "DocType"
SBU = "HELP"

CLOSE DATABASES
Select 1 && selects first available work area
Use Special && opens table, refer to after this as table1
APPEND BLANK && Start with a new Record

For x = 001 to 99
REPLACE Special.Policy WITH Policy
REPLACE Special.Company WITH Company
REPLACE Special.DocType WITH DocType
REPLACE Special.SSN WITH SSN
REPLACE Special.System WITH System
REPLACE Special.WorkNUM WITH WorkNUM
REPLACE Special.SBU WITH SBU
REPLACE Special.Batch WITH Batch + STR(X)
REPLACE Special.Work WITH Work
APPEND BLANK &&<--Create Blank
EndFor

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Print the Reports
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&SET Console OFF

CLOSE DATABASES
Select 1
Use Special

REPORT FORM specialreport.frx NOEJECT NOCONSOLE PREVIEW

&&use Special

DO FORM delextrt &&Asks if Print was ok...

&&close tables all ******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf
 
Not much to go by here. Blank reports usually indicate no records matched the criteria for inclusion in the report. This could be several things.

Take a look at your report first to make sure at least one record matches your criteria. Check the filters and or your select statements to be sure your criteria actually returns matching records. Try testing your report criteria in the command window.

Best Of Luck
The 2nd mouse gets the cheese.
 
If you find command window fails to return any records, try building the conditions you test for into the command window from scratch- adding one new condition to it each time. This can help identify which one of the parameters actually caused &quot;all&quot; records to be excluded.
The 2nd mouse gets the cheese.
 
Hi Pogowolf,

Your problem is stemming from the fact that the memory variables have the same name as the table fields.

Try:

REPLACE Special.Policy WITH m.Policy
REPLACE Special.Company WITH m.Company etc.

Jim
 
The way it's working is that the code above fills the database the report reads from. the program isn't even getting that far.. the logic is the user presses a button calling this code.. the code populates 100 records with the above data.. and the report just spits it back out..

I've double checked to make sure the column names where spelled correctly (they are) and everything 'matches' and it does.. but for some reason.. the above code isn't putting the data into the database itself..

=(

******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf
 
jimstarr ,
Thanks!!! that was the issue.. funny that error hasn't creeped up on the other 3 odd Databases that are in this code.. But that was the issue.. thank you!

now for the minor issue of it not adding the 'X' to the 'Batch'....
******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf
 
Watch out for STR(X) - it's a 10-character field. Do you have room for it?

You may want: ALLTRIM(STR(X))

Jim
 
Revised Code
=========CODE===============
&&INIT
&&&&&&&&&&&&&&&&&&&&&
CLOSE DATABASES
Select 0 && selects first available work area
Use Special && opens table, refer to after this as table1
LOCATE
SCTTER MEMVAR BLANK

&&Check Input from Option Buttons
IF ThisForm.Batch.Value = 1 then
m.Batch = &quot;Foo&quot;
m.Work = &quot;Foobar&quot;
Else
m.Batch = &quot;Foo2&quot;
m.Work = &quot;FOobar2&quot;
ENDIF

STORE &quot;XXXBLANK&quot; TO m.Policy, m.Company, m.SSN, ;
m.System, m.WorkNum
m.DocType = &quot;DocType&quot;
m.SBU = &quot;HELP&quot;

For x = 001 to 99
APPEND BLANK && Start with a new Record
GATHER MEMVAR
REPLACE Batch WITH M.Batch+ALLTRIM(STR(x))
EndFor
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Print the Reports
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&SET Console OFF

** CLOSE DATABASES
** Select 1
** Use Special
LOCATE
REPORT FORM specialreport.frx NOEJECT NOCONSOLE PREVIEW
&&use Special
DO FORM delextrt &&Asks if Print was ok...
&&close tables all
******
Hope this gives you the result.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
My Goodness, by the time I complete the postings, almost 5 replies have been added ! Well done tek-ip members ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
WEll done I must say!!! =) LOL

jimstarr: Yep.. that was the issue again.. I forgot that
FP Pads it..

ramani: WOw thanks!!!! that does give me a little more
insite to how things work with FoxPro.. I was kinda shuffed into doing a project with no previous Knowleadge of FP except for I heard the name before.. LOL

so it's a learn as I go thing.. but over the past two days I've learned allot from you guys. Thanks again, and keep up the good work!!! =)


******
Darkness... Bleakness...
and Plastic forks...
--The PogoWolf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top