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

Runtime error 3071

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
I have a query in Access that retrieves all the record details based on user input on my form for date range and a selection from either one of two combo boxes. A different combo box will display based on a selection from an option group (1 or 2).

My report will hide the detail and show the data grouped by either combo1 (Group) or combo2 (Pyramid). I get the runtime error "The expression is typed incorrectly.....blah blah blah"

The filters passed to the report is as follows:
For combo2:
"([Date] between #10/1/2005# and #02/08/2006#) and [Pyramid] = 'P3'"

For combo1:
"([Date] between #10/1/2005# and #02/08/2006#) and [Group] = 'AAA999'"

My open event for the report is as follows:

Code:
Option Compare Database

Private Sub Report_Open(Cancel As Integer)
    
    Select Case Forms!frmCriteria!optGrpPyramid
        
    Case 1 'By Group
        Me.lblTitle.Caption = "Report by Group"
        Me.GroupLevel(0).ControlSource = "Group"
        Me.GroupLevel(0).GroupOn = 4
        Me.txtGroupID.Visible = True
        Me.txtPyramid.Visible = False
        Me.lblGroupLevel.Caption = "Group"
        
    Case 2 'ByPyramid
        Me.lblTitle.Caption = "Report by Pyramid"
        Me.GroupLevel(0).ControlSource = "Pyramid"
        Me.GroupLevel(0).GroupOn = 4
        Me.txtGroupID.Visible = False
        Me.txtPyramid.Visible = True
        Me.lblGroupLevel.Caption = "Pyramid"
    End Select

End Sub

Any ideas?


 
OK my problem with that error was that I still had the date criteria in the query.

I removed it, and now I get a Data Type Mismatch error.

any ideas?




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top