Dreaded "Enter Parameter Value" message - in a Where clause

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting that stupid "Enter Parameter Value" message, but I am 100,000%
sure that it isn't a simple typo in a field name or anything.

The where clause works fine when it looks like so:

myWhereClause = "tblProjectInfo.[ProjectMgr] = " & "'" & Me.cboProjectMgr &
"'"

or for testing purposes, hard coding a name in:

myWhereClause = "tblProjectInfo.[ProjectMgr] = " & "'CHESTER'"

However, I added a new field to tblProjectInfo, at this point it is just
called "test" because I wanted to eliminate any chance that I was spelling it
wrong in my where clause.

When I do the following, I inevitably get the Enter Parameter Value message,
and then in the prompt it asks for me to supply tblProjectInfo.test

myWhereClause = "tblProjectInfo.[test] = " & "'help'"

I've checked, double-checked and re-checked. The "test" field IS in the
tblProjectInfo table, it is spelled "test", it is a string field, and at
least some of the records have a value of "help" (not that that would matter).

I closed the database and re-opened it, and I also did a compact and repair.
It is just acting like the new field doesn't exist...

Has anyone ever encountered anything like this??? Please let me know if you
need any more detail or more code sample...

Thanks!
Mike
 
I assume you are using this WhereCondition to open a form or report
If you added that field to the table after the form/report were created, did
you add that field to the RecordSource of the Form/Report

If you didn't, that might be the cause for the error.
If the form RecordSorce include a list of field

Select Field1, Field2,Field2 from TableName

Either add the new field, or change it to
Select TableName.* from TableName

That way, next time you will add a field to the table you won't need to add
it to the form/report
 
Yep, that was it. I have an unbound form that is used to launch some VBA code
to create dynamic reports, and I totally forgot that the report templates
have queries sans where clauses that needed updated..

Thanks! - Mike

Ofer Cohen said:
I assume you are using this WhereCondition to open a form or report
If you added that field to the table after the form/report were created, did
you add that field to the RecordSource of the Form/Report

If you didn't, that might be the cause for the error.
If the form RecordSorce include a list of field

Select Field1, Field2,Field2 from TableName

Either add the new field, or change it to
Select TableName.* from TableName

That way, next time you will add a field to the table you won't need to add
it to the form/report

--
Good Luck
BS"D


Michael D. said:
I am getting that stupid "Enter Parameter Value" message, but I am 100,000%
sure that it isn't a simple typo in a field name or anything.

The where clause works fine when it looks like so:

myWhereClause = "tblProjectInfo.[ProjectMgr] = " & "'" & Me.cboProjectMgr &
"'"

or for testing purposes, hard coding a name in:

myWhereClause = "tblProjectInfo.[ProjectMgr] = " & "'CHESTER'"

However, I added a new field to tblProjectInfo, at this point it is just
called "test" because I wanted to eliminate any chance that I was spelling it
wrong in my where clause.

When I do the following, I inevitably get the Enter Parameter Value message,
and then in the prompt it asks for me to supply tblProjectInfo.test

myWhereClause = "tblProjectInfo.[test] = " & "'help'"

I've checked, double-checked and re-checked. The "test" field IS in the
tblProjectInfo table, it is spelled "test", it is a string field, and at
least some of the records have a value of "help" (not that that would matter).

I closed the database and re-opened it, and I also did a compact and repair.
It is just acting like the new field doesn't exist...

Has anyone ever encountered anything like this??? Please let me know if you
need any more detail or more code sample...

Thanks!
Mike
 
Back
Top