View Single Post
  #1  
Old November 13th, 2009, 05:04 PM posted to microsoft.public.access.forms
Rockn[_2_]
external usenet poster
 
Posts: 5
Default Two message boxes

I have two message boxes that fire off when I am going to print a report to
determine what will show up on the report as far as fields. The first
message box is to hide the customer price on a quote, if you answer yes it
sets a checkbox on the initial form to true. The next message box is to show
or hide the changes made to the quote on the report. If I say vbyes to both
of the message boxes the customer pricing will not be hidden as the checkbox
is getting set back to false. I am not sure why it is toggling, but it works
if I answer yes to the first and no to hte second. It may just be the order
in which the events are happening or the initial state of the checkbox. Code
below:

Case 1

If IsNull(Me.[Text147]) And IsNull(Me.[Text133]) Then
rptType = "rpt_CustomerCopy"
End If
If IsNull(Me.[Text147]) And Not (IsNull(Me.Text133)) Then
rptType = "rpt_CustomerCopyDisc"
End If
If Not (IsNull(Me.Text147)) And IsNull(Me.[Text133]) Then
rptType = "rpt_CustomerCopyAdd"
End If
If Not (IsNull(Me.Text147)) And Not (IsNull(Me.[Text133])) Then
rptType = "rpt_CustomerCopyBoth"
End If

HideCost = MsgBox("Hide Homeowner Cost?", vbYesNo, "Hide Cost")
If HideCost = vbYes Then
Me.Check161.Value = True
End If
If HideCost = vbNo Then
Me.Check161.Value = False
End If


LResponse = MsgBox("Show Changes on Report?", vbYesNo, "Print Changes?")
DoCmd.OpenReport rptType, acPreview, , "[JOB_ID]= " & Me.[JOB_ID]
If LResponse = vbYes Then
Reports(rptType).Report!rpt_Change.Visible = True
End If

DoCmd.Maximize
DoCmd.RunCommand acCmdZoom100