Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2006, 08:22 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Copy and paste my email address to your standard email package and email me from there.


mmcdonal
 
Old June 8th, 2006, 08:41 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't see your e-mail address. it just shows your name.

dave

 
Old June 8th, 2006, 08:43 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

email me, and I will email you back. Then attach the file.

mmcdonal
 
Old June 8th, 2006, 10:38 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is the resolution. The issues were proper field name reference and proper control values:

Private Sub btnPreviewReport_Click()
On Error GoTo Err_btnPreviewReport_Click

    Dim stDocName As String
    Dim str20 As String
    Dim str40 As String
    Dim sLink As String

    stDocName = "Floor Requests"

    If Me.chk20 <> -1 And Me.chk40 <> -1 Then
        MsgBox """Select a JITL""", vbOKOnly
    Else
        If Me.chk20 = -1 Then
            str20 = "Y"
            Else
            str20 = "N"
        End If
        If Me.chk40 = -1 Then
            str40 = "Y"
            Else
            str40 = "N"
        End If
    End If
    sLink = "[Twenty] = " & "'" & str20 & "' AND [Forty] = " & "'" & str40 & "'"
DoCmd.OpenReport stDocName, acPreview, , sLink
Exit_btnPreviewReport_Click:
    Exit Sub
Err_btnPreviewReport_Click:
    MsgBox Err.Description
    Resume Exit_btnPreviewReport_Click

End Sub

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple criteria on a select query? jihadbuster XSLT 4 March 19th, 2008 01:52 PM
IIF multiple criteria stealthdevil Access VBA 10 November 28th, 2007 11:37 AM
Multiple Search Criteria in a Form tet Access VBA 5 October 27th, 2007 08:54 AM
stLinkCriteria - Multiple Criteria andyv123 Access 1 September 8th, 2006 10:02 AM
Criteria query with multiple fields penta Access 8 October 25th, 2004 11:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.