Link to home
Start Free TrialLog in
Avatar of Jon Bredensteiner
Jon BredensteinerFlag for United States of America

asked on

Dropdown List in Access for a Report

Hello again,
     I'm sure this is an easy question, and I have already had one very simular to it answered.  Here is a link to the last question like this one I posted: https://www.experts-exchange.com/questions/22061922/Dropdown-List-in-Access-for-a-Report.html

This time the dropdown will be selecting a number instead of a string.  Thank you in advance for your help.  Here is the code I'm trying to use, but of course I am getting a data type mismatch error, so please help me change it:

Option Compare Database
Option Explicit
Dim strFilter As String

Private Sub cmdOpenReport_Click()
DoCmd.OpenReport "rpt_weekly_group", acViewPreview, , strFilter
End Sub

Private Sub Detail_Click()

End Sub

Private Sub GruopID_AfterUpdate()
strFilter = ""

    If Me.GruopID <> "" And Not IsNull(Me.GruopID) Then
        If strFilter = "" Then
            strFilter = "[GruopID]= " & Chr(34) & Me.GruopID & Chr(34) & ""
        Else
            strFilter = strFilter & " and [GruopID]= " & Chr(34) & Me.GruopID & Chr(34) & ""
        End If
    End If
End Sub
ASKER CERTIFIED SOLUTION
Avatar of jefftwilley
jefftwilley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jon Bredensteiner

ASKER

Your the best.  I love EE :)
Anytime...hey, "Gruop"??? lol

oops
J
I know, I just found that out the other day, when I kept getting errors, and after about an hour of banging my head against the keyboard I noticed "Gruop".  It is pretty much too late to change it now :)