473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Keep getting "Enter Parameter Value" when running a new report filter

anoble1
245 128KB
I am trying to limit my report by a combo-box filter on a main report screen.

Says: "Enter Parameter Value"
then has my value I actually chose in the search below. Then a white blank. If I type in what i filtered manually it works. If I leave it blank it does not work.

Here is some of the code I have for this particular box. When I "View the Report"
Expand|Select|Wrap|Line Numbers
  1. Dim Category As String
  2. Forms!frmReports!cmdCategory.SetFocus
  3. Category = Forms!frmReports!cmdCategory.Value
  4. If Category <> "" Then
  5.     whereCond = "Category = " & Forms!frmReports!cmdCategory.Value
  6. End If
  7. DoCmd.OpenReport "rptFitNotesSummary", acViewPreview, , whereCond
If I scroll my mouse over the "whereCond = "Category =...." It has my filter in there. Suggestions? I am missing something.
Jan 30 '15 #1

✓ answered by Seth Schrock

Somewhere there is a field name typed incorrectly. If you open the report without the WhereCondition, does it open without the "Enter Parameter Value" message? If so, then the problem is with your whereCond variable value. By the way, I see you Dim Category, but not whereCond and you set the Category variable, but then don't use it to build your whereCond varible.

2 1459
Seth Schrock
2,965 Expert 2GB
Somewhere there is a field name typed incorrectly. If you open the report without the WhereCondition, does it open without the "Enter Parameter Value" message? If so, then the problem is with your whereCond variable value. By the way, I see you Dim Category, but not whereCond and you set the Category variable, but then don't use it to build your whereCond varible.
Jan 30 '15 #2
anoble1
245 128KB
I went around the issue and went in the Report VBA and created some code.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. Dim Exercise As String
  3. Dim Category As String
  4. Dim Weight As String
  5.  
  6. Forms!frmReports!cmdCategory.SetFocus
  7. Category = Forms!frmReports!cmdCategory.Value
  8.  
  9. If Category <> "" Then
  10.     Me.RecordSource = "SELECT tblFitNotes.FitID, tblFitNotes.Date, tblFitNotes.Exercise, tblFitNotes.Category, tblFitNotes.Weight, tblFitNotes.Reps, tblFitNotes.Distance, tblFitNotes.DistanceUnit, tblFitNotes.Time FROM tblFitNotes WHERE (((tblFitNotes.Category)=[Forms]![frmReports]![cmdCategory].[Value]));"
  11. Else
  12. Category = Forms!frmReports!cmdCategory.Value
  13. End If
Jan 30 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: mikey_boy | last post by:
Hello! Curious if anyone could give me a hand. I wrote this PHP script with makes a simple connection to a mysql database called firstdb and just pulls back the results and displays on the...
2
by: Roger | last post by:
Anyone know how to pass a parameter to a query via a report in Access 2003?
7
by: fleece | last post by:
I set up a form for searching criteria and pass the searching result to a report. On this report there is an unbound text box (=.Filter) and shows the searching criteria. It works fine when searching...
5
by: Dan Fulbright | last post by:
I'm trying to install PHP 5.2.2 on Windows, but I keep getting errors when running go-pear.bat: mmap cache can't open phar://go-pear.phar/index.php mmap cache can't open...
2
by: Malt via AccessMonster.com | last post by:
Hi; I would like to place a date range in a report header that matches the input dates a user enters through a parameter query when the report is run. The query contains the following in the...
3
by: kbcompany | last post by:
Hi I have just started learning oracle. i have created a table with name imp_master and columns item_code with constraint not null, item_name with constraint n1 not null(n1 is user...
1
by: imtmub | last post by:
Hi All, I have mainpage (POselect.aspx). language VB In that page i have a textbox (txtPOId) and command button(Button1) When i press then button its should send the textbox value to Crystal...
3
by: James Watson | last post by:
'Microsoft VB 6.3, Access 2002 'Syntax error in the INSERT INTO Statement when the query runs 'How can I make this work? Private Sub Command52_Click() On Error GoTo Err_Command52_Click ...
0
by: Marie Gardner | last post by:
Hi, I want to create a form that filters a report that is between a date range, and includes only the data for the item selected in the combo box. For example, I am creating a time manager...
4
by: Paul Howarth | last post by:
I posted this question.... http://bytes.com/topic/access/answers/946707-crosstab-queries-responsible-access-error-msg ...and was provided with the following support link which completely...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.