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

What happen it won't print?

Status
Not open for further replies.

chsu

Programmer
Jan 19, 2000
17
US
Hi everyone!

I am testing on the module. And I am writing the code:
'WORLD - BULOCP
Set rsStruc = dbStruc.OpenRecordset("REGBULOCP", dbOpenSnapshot)
rsStruc.MoveFirst
Do Until rsStruc.EOF
strBU = Right(rsStruc.Fields("BUSINESS_UNIT"), 3)
strBUDesc = rsStruc.Fields("Bu ShortDesc")
strLOC = rsStruc.Fields("LOCAL_CTRY")
strLOCDesc = rsStruc.Fields("LOCAL_SHORTDESCR")
strCCC = rsStruc.Fields("CURCODE")
strP = rsStruc.Fields("PRACTICE")
strPDesc = rsStruc.Fields("DESCRIPTION")
'NAME - WORLD
strEnt = strBU & strLOC & "000" & strP
strEnt2 = strBU & strLOC & "USD" & strP
strEntDesc = strLOCDesc & " " & strPDesc
If strEnt1 <> strEnt And strP <> 0 Then Print #intName, strEnt & &quot;!&quot; & strEntDesc & &quot;!&quot; & strBU & strP & strNameEnd & strCCC & strNameEnd1
If strEnt3 <> strEnt2 And strP <> 0 Then Print #intName, strEnt2 & &quot;!&quot; & strEntDesc & &quot;!&quot; & strBU & strP & &quot; ! !USD !0! ! ! ! !CHART! ! ! !CHART&quot;
'OWNER - WORLD
If strEnt1 <> strEnt And strP <> 0 Then Print #intOwn, strBU & strLOC & &quot;!&quot; & strEnt & strOwnEnd
If strEnt3 <> strEnt2 And strP <> 0 Then Print #intOwn, strBU & strLOC & &quot;!&quot; & strEnt2 & strOwnEnd
strEnt1 = strEnt
strEnt3 = strEnt2
rsStruc.MoveNext
Loop
rsStruc.Close

When it run:
AME000001
AME000002
AME000004
AME000005
AME000007
NOR100001
NOR100002
NOR100004
....
....


What I need for example below:
AME000000
AME000001
AME000002
AME000004
AME000005
AME000007
AME000009
GER000000
GER000001
....
....

It won't print &quot;0&quot; and &quot;9&quot;. I did check the table which it has! It s no problem but the module is not working. Or Am I missing?

Please help me out.

Thanks,
chsu [sig][/sig]
 
first thing I see is:

strP <> 0
If you want a zero to show up then you cannot test for <> 0
casue you will never get a zero
Try greater than -1, like so:
> -1

As far as the 9 is concerned. Are you using debug to see what values you are getting and what your logic is doing.

Open your code window and click on this line:

Do Until rsStruc.EOF

and Press F9 key , it should put a RED line there.

then close your code window and view your form when you click the button it should pop up the code window and stop on the red line. Then press F8 to step one line at a time.
Press Ctrl-G to bring up the Immediate window to see your values.
in the bottom of the Immediate window
type ?strEnt and press enter after it passes that variable
it will print out what's in strEnt at the moment in time.

Note: no variable will have anything in it untillafter you pass it.

Now you can see what's not right with your code....



[sig]<p>DougP, MCP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top