By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

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

anoble1
100+
P: 230
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.

Share this Question
Share on Google+
2 Replies


Seth Schrock
Expert 2.5K+
P: 2,951
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
100+
P: 230
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

Post your reply

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