Solved

Dropdown List in Access for a Report

Posted on 2006-11-30
4
230 Views
Last Modified: 2013-11-28
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: http://www.experts-exchange.com/Databases/MS_Access/Q_22061922.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
0
Comment
Question by:JBredensteiner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
jefftwilley earned 250 total points
ID: 18049037
Private Sub GruopID_AfterUpdate()
strFilter = ""

    If NZ(Me.GruopID)<>"" Then
        If strFilter = "" Then
            strFilter = "[GruopID]= " & Me.GruopID
        Else
            strFilter = strFilter & " and " & [GruopID]= " & Me.GruopID
        End If
    End If
End Sub
0
 

Author Comment

by:JBredensteiner
ID: 18050098
Your the best.  I love EE :)
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18050677
Anytime...hey, "Gruop"??? lol

oops
J
0
 

Author Comment

by:JBredensteiner
ID: 18050995
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 :)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question