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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I remove an "OK message"? 2

Status
Not open for further replies.

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.

 
check your code for msgbox statement and rem it out
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top