[AccessD] Strange Command Button Behavior

Kaup, Chester Chester_Kaup at kindermorgan.com
Mon Oct 1 09:27:38 CDT 2007


I have a command button in the header of form to print a report. When I click on the button the focus moves from a text box on the form named StartDate to a text box on the form named EndDate. The report does not print. The second time I click the command button the form prints. Code for the command button is below. I tried compacting and repairing the database and moving everything to a new form but to no avail. 

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

    Dim stDocName As String

    stDocName = "rpt All Manifolds Oil Gas Water 90 Days"
    DoCmd.OpenReport stDocName, acNormal

Exit_Command1_Click:
    Exit Sub

Err_Command1_Click:
    MsgBox Err.Description
    Resume Exit_Command1_Click
    
End Sub


Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.





More information about the AccessD mailing list