Solved

filter report content using vba

Posted on 2007-11-28
3
545 Views
Last Modified: 2010-10-05
i'm trying to open a report filtered to a certain ref:

 Dim stDocName As String

    stDocName = "PAYMENTRECIEPTSBANK"
DoCmd.OpenReport stDocName, acViewPreview, , wherecondition:="TransferRef = " &  Me.TransferRef

the transferref Datatype is Text because it is a mix of details which may be entered

Any Suggestion to why it does not filter the report????

rgds

benyaw
   
0
Comment
Question by:Benyaw
  • 2
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 20366201
try

Dim stDocName As String

    stDocName = "PAYMENTRECIEPTSBANK"
DoCmd.OpenReport stDocName, acViewPreview, ,"[TransferRef] = '" &  Me.TransferRef &"'"
0
 

Author Closing Comment

by:Benyaw
ID: 31411434
Thank you very much
0
 

Author Comment

by:Benyaw
ID: 20366268
worked perfect........thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

948 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

17 Experts available now in Live!

Get 1:1 Help Now