Solved

Dropdown List in Access for a Report

Posted on 2006-11-30
4
225 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
  • 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now