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

Flushing problem?

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
0
0
US
Hello all!
I've been working on a project for the past few days, and I've run into a snag that I'm just not seeing where the problem is.

What's happening is a user enteres data into two text boxs.
(txt_NBAP and txt_INFO). These numbers make up a 'set' of records that are entered into a table.

I'm also createing a Work Item that is being created on the fly, from the number of 'sets' that are being made..
the issue is the number is sets doesn't seem to be updateing correctly..

can anyone help me with this? I know this might be a huge post, and you can Email me at pogowolf@hotmail.com if you want the full source, or to take this off the list. =)

<---- Beginning Code ---->

&& Start the 'Sets' For..Next Loop &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
For X = 1 to VAL(alltrim(ThisForm.txtNumber.value))

&& Set the CompanyID and Company Code ID
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
IF AT(&quot;CONV&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;CAF&quot;
ID = 3
ENDIF

IF AT(&quot;DDIR&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;CAF&quot;
ID = 2
ENDIF

IF AT(&quot;SDPR&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;CAF&quot;
ID = 1
ENDIF

IF AT(&quot;SOOE&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;MSCHIC&quot;
ID = 4
ENDIF

IF AT(&quot;MSOE&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;MSCHIC&quot;
ID = 5
ENDIF

IF AT(&quot;COMP&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;MSCHIC&quot;
ID = 6
ENDIF

IF AT(&quot;NOW&quot;,UPPER(ThisForm.CBOQueueName.Value)) > 0 THEN
CompanyID = &quot;CAF&quot;
ID = 9
ENDIF


&&Get the Current Counter (as Per Queue)
&&Store into WorkNum
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

CLOSE DATABASES
USE HNBQue IN 0 ALIAS HNBQue && opens the table
GO TOP IN HNBQue
Store HNBQue.count TO sWorkFix

&& Creates the Work WorkItem Number
&& Date + Code + SquenceNumber
&& Fix the Squence number if need be...
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
if LEN(ALLTRIM(upper(STR(sWorkFix)))) < 5 then
Do Case
Case LEN(ALLTRIM(upper(STR(sWorkFix)))) = 0
Squ = &quot;00000&quot; + ALLTRIM(STR(sWorkFix))
Case LEN(ALLTRIM(upper(STR(sWorkFix)))) = 1
Squ = &quot;0000&quot; + ALLTRIM(STR(sWorkFix))
Case LEN(ALLTRIM(upper(STR(sWorkFix)))) = 2
Squ = &quot;000&quot; + ALLTRIM(STR(sWorkFix))
Case LEN(ALLTRIM(upper(STR(sWorkFix)))) = 3
Squ = &quot;00&quot; + ALLTRIM(STR(sWorkFix))
Case LEN(ALLTRIM(upper(STR(sWorkFix)))) = 4
Squ = &quot;0&quot; + ALLTRIM(STR(sWorkFix))
EndCase
endif

&& Make the Month '0?' if needed.
IF LEN(ALLTRIM(STR(MONTH(Date( ))))) < 2 then
M.sMonth = &quot;0&quot; + ALLTRIM(STR(MONTH(Date( ))))
Else
M.sMonth = ALLTRIM(STR(MONTH(Date( ))))
Endif

&& Make the Day '0?' if needed.
IF LEN(ALLTRIM(STR(Day(Date( ))))) < 2 then
M.sDay = &quot;0&quot; + ALLTRIM(STR(Day(Date( ))))
Else
M.sDay = ALLTRIM(STR(Day(Date( ))))
Endif

m.sWorkFix = M.sMonth + M.sDay + ALLTRIM(STR(ID)) + ALLTRIM(SQU)


&& Database Set up
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&CLOSE DATABASES
USE HealthNBBATCH IN 0 ALIAS HealthNBBatch && opens the table

&& NBAP For..Next Loop
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& For Y = 0 to NumofNBAP-1
if NumofNBAP <> 0 AND y <= NumofNBAP then
APPEND BLANK && Start a new Record
GO BOTTOM IN HealthNBBATCH
&& Place Normal Data Fields in to the Database.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Todays Date
REPLACE HealthNBBatch.Date WITH Date () IN HealthNBBatch

&& Version Data
REPLACE HealthNBBatch.VersionDat WITH VerDATE IN HealthNBBatch

&& Queue Name
REPLACE HealthNBBatch.queue WITH UPPER(ThisForm.cboQueueName.Value) IN HealthNBBatch

&& Set Company Code
REPLACE HealthNBBatch.Company WITH UPPER(CompanyID) IN HealthNBBatch

&& Set WorkID
REPLACE HealthNBBatch.WorkNum WITH UPPER(M.sWorkFix) IN HealthNBBatch

&& DocType
REPLACE HealthNBBatch.doctype WITH &quot;NBAP&quot; IN HealthNBBatch

FLUSH && Force DB to update.
Endif
NEXT

&& INFO For..Next Loop
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& For Y = 0 to NumOfInfo-1
if NumOfINFO <> 0 and Y <= NumOfINFO then
APPEND BLANK && Start a new Record
GO BOTTOM IN HealthNBBATCH

&& Place Normal Data Fields in to the Database.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&& Todays Date
REPLACE HealthNBBatch.Date WITH Date() IN HealthNBBatch
REPLACE HealthNBBatch.VersionDat WITH VerDATE IN HealthNBBatch && Version Data
REPLACE HealthNBBatch.queue WITH UPPER(ThisForm.cboQueueName.Value) IN HealthNBBatch && Queue Name
REPLACE HealthNBBatch.Company WITH UPPER(CompanyID) IN HealthNBBatch && Set Company Code
REPLACE HealthNBBatch.WorkNum WITH UPPER(M.sWorkFix) IN HealthNBBatch && Set WorkID
REPLACE HealthNBBatch.doctype WITH &quot;INFO&quot; IN HealthNBBatch && DocType
FLUSH
EndIF
NEXT


*************
Here's where it seems the problem is.. after working though
all the above, the program should update this counter..
the issue is that it doesn't seem to update until AFTER
the Beginning For-Next loop...
**************

&&Update the Queue Counters
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
CLOSE DATABASES
USE HNBQue IN 0 ALIAS HNBQue && opens the table
LOCATE FOR HNBQue.Que = Upper(ThisForm.cboQueueName.Value)
DO WHILE FOUND( )
Store HNBQue.Count TO sWorkFix
sWorkFix = sWorkFix + 1
REPLACE HNBQue.count WITH sWorkFix IN HNBQue
REPLACE HNBQue.Date WITH DATE( ) IN HNBQue
FLUSH
CONTINUE
ENDDO
Next
<---- End Code -----> ---===///The PogoWolf\\\===---
Amateurs built the ark, Professionals built the Titanic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top