I am new to Microsoft Access.
I added some queries to an old and existing database (.accdb) using Microsoft Access 2007.
I created two forms in Access, and two buttons in the Switchboa开发者_如何学Gord.
Whenever the buttons are clicked, I load the form which was created using the SQL query through the Form Wizard.
However, now whenever I print, the particular form which has the print button using the following old existing code.
Private Sub CmdPrintInv_Click()
On Error GoTo Err_CmdPrintInv_Click
Dim stDocName As String
Dim sqlstr As String
sqlstr = "InvType='" & InvType.Value & "' AND InvNo='" & InvNo & "'"
stDocName = "R-Invoice"
DoCmd.OpenReport stDocName, acNormal, , sqlstr
Exit_CmdPrintInv_Click:
Exit Sub
Err_CmdPrintInv_Click:
MsgBox Err.Description
Resume Exit_CmdPrintInv_Click
End Sub
Previously, the database was working fine after clicking print. The other buttons were responsive.
Now, the database lags, particularly the window attached. Whenever I try to click other buttons, they are not responsive.
Any advise would help me out.
精彩评论