Dec 29, 2002 #1 Rmcta Technical User Nov 1, 2002 478 US When my report opens, I also get a little window: ____________________ Microsoft Access |X| | OK | | ____________________| How do get rid of it? I don't want it to pop up.
When my report opens, I also get a little window: ____________________ Microsoft Access |X| | OK | | ____________________| How do get rid of it? I don't want it to pop up.
Dec 29, 2002 2 #2 PWise Programmer Dec 12, 2002 2,633 US check your code for msgbox statement and rem it out Upvote 0 Downvote
Dec 29, 2002 Thread starter #3 Rmcta Technical User Nov 1, 2002 478 US Pwise, here is the code. Can you indicate to me what to do? Private Sub cmdOpenReport_Click() On Error GoTo Err_cmdOpenReport_Click Dim strVal As String Dim strDocName As String Dim dteValFrom As Date Dim dteValTo As Date strVal = Me.cboCountry dteValFrom = Me.txtFromDate dteValTo = "rptStays" If strVal = "All Countries" Then DoCmd.OpenReport strDocName, acPreview, , "[FromDate]Between(#" & dteValFrom & "#) AND (#" & dteValTo & "#)" Else DoComd.OpenReport strDocName, acPreview,,"Country='" & strVal & "' AND [FromDate]Between(#" & dteValFrom & "#) AND (#" & dteValTo & "#)" End If Err_cmdOpenReport_Click: MsgBox Err.Description Exit Sub End Sub Upvote 0 Downvote
Pwise, here is the code. Can you indicate to me what to do? Private Sub cmdOpenReport_Click() On Error GoTo Err_cmdOpenReport_Click Dim strVal As String Dim strDocName As String Dim dteValFrom As Date Dim dteValTo As Date strVal = Me.cboCountry dteValFrom = Me.txtFromDate dteValTo = "rptStays" If strVal = "All Countries" Then DoCmd.OpenReport strDocName, acPreview, , "[FromDate]Between(#" & dteValFrom & "#) AND (#" & dteValTo & "#)" Else DoComd.OpenReport strDocName, acPreview,,"Country='" & strVal & "' AND [FromDate]Between(#" & dteValFrom & "#) AND (#" & dteValTo & "#)" End If Err_cmdOpenReport_Click: MsgBox Err.Description Exit Sub End Sub
Dec 29, 2002 #4 PWise Programmer Dec 12, 2002 2,633 US after the end if line type this exit sub since ther is no exit sub statement before the error handler it always excutes the error handler Upvote 0 Downvote
after the end if line type this exit sub since ther is no exit sub statement before the error handler it always excutes the error handler
Dec 30, 2002 Thread starter #5 Rmcta Technical User Nov 1, 2002 478 US Thank you Pwise Upvote 0 Downvote