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!

code not being run in the on-close of a form

Status
Not open for further replies.

tziviak2

MIS
Jul 20, 2004
53
US
I have code-that opens a report as long as there is data in the tbl. when the user closes the report-a boolean is set to false-so that way it'll signal for the code to continue-but I close the report-and the code is still waiting for the boolean to be changed-it never stops at the on-close of the report. here's the code:
Code:
rptatt = True

    stDocName = "rptAttendanceRecord"
    
    stLinkCriteria = "[barcode]=" & Barcode
    DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
    
  While rptatt = True
  DoEvents
  Wend

and at the onclose of the report:
Code:
 rptatt=false
but it never gets set to false-I even tracked it-and doesn't stop in the on-close any ideas why?
 
Is it a global variable?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
tziviak2, you should never start a new thread on an open posting. New people joining in don't know what's already been offered/tried and will waste time, yours and theirs. This thread is still on the current page of the forum:


The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top