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!

Problem Printing a report for Button on Form

Status
Not open for further replies.

Siphroma

IS-IT--Management
Jun 27, 2007
3
US
SO I have a simple for that has a button on it. When you click the button it sets a Check43 to TRUE then Runs a report based on a query that prints everything with check43= TRUE. But for some reason the query is not updating that checkbox1= true even though I can se the checkbox being checked. Here is what it looks like Note I put all IF statements in to be sure that the CHECK43 field is actually set to true during the steps of the process. yet when the report prints it says nothign has check43 = TRUE. Im thinking it has something to do with refreshing or something but im not a programmer so any help would be appreciated. Thanks

Private Sub Command42_Click()
On Error GoTo Err_Command42_Click

Dim stDocName As String
Dim Buttpress As Integer

If [Check43] = False Then [Check43] = True
stDocName = "AssetTag"
If [Check43] = True Then GoTo PrintAT

Exit_Command42_Click:
Exit Sub

Err_Command42_Click:
MsgBox Err.Description
Resume Exit_Command42_Click

PrintAT:
If [Check43] = True Then DoCmd.OpenReport stDocName, acNormal
GoTo AfterPrint

AfterPrint:
Butpress = MsgBox("Did the asset tag print Correctly?", 4, "Asset Printed?")
If Butpress = 7 Then GoTo PrintAT
If Butpress = 6 Then [Check43] = False
Exit Sub
End Sub
 
Save the current record before printing:
Me.Dirty = False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
DAmn I spent all this time doing stuff and all I needed was 3 lousy words. Thank You It works fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top