Access require a parameter value

richardw

Registered User.
Local time
Yesterday, 19:02
Joined
Feb 18, 2016
Messages
48
Dear all :)

I am using Access 2007.

I am building a form, almost finished, but the last part sucks.
I did a SELECT statement to bring a value based on several criterias but when I run it, it demands A PARAMETER VALUE.

Here is the SELECT Statement :

Code:
totprecsql = "SELECT tbl_actualVal.[totalFTE] " & _
        "FROM tbl_actualVal WHERE tbl_actualVal.[monthActual] = " & Me.perPrec & " AND tbl_actualVal.[typeActual] = INTernalfte AND  tbl_actualVal.[yearActual] = " & Me.yearActual & " AND  tbl_actualVal.[idInitiative] = " & Me.idInitiative & " "

The syntax is correct because when I enter the value it shows the one that I expect. But entering this value by users would make them nervous ..

The parameter demanded is based on this part of the statement :

Code:
tbl_actualVal.[typeActual] = INTernalfte



Do you have a solution for this ?

Thanks in advance :) :)
 
then what is INTernalfte, is it a field?
 
Hi arnelgp,

Yes it is a value in the field which i wish use a criteria.
 
its not recognizing it, is the spelling correct?
should you qualify a table in it:

tbl_actualVal.InternalFte
 
Hi arnelgp,

Yes, the spelling is correct.
I tried you suggestion but still have the same problem.

Thank you anyway.
 
if it is no same table, then it would be recognised.
 
No solution worked, but I did in another way.
Solution :

Code:
totprecsql = "SELECT tbl_actualVal.[totalFTE], tbl_actualVal.[typeActual], tbl_actualVal.[averageFTE] " & _
        "FROM tbl_actualVal" & _
        " WHERE tbl_actualVal.[monthActual] = " & Me.perPrec & " AND tbl_actualVal.[yearActual] = " & Me.yearActual & " AND  tbl_actualVal.[idInitiative] = " & Me.idInitiative & " ORDER by tbl_actualVal.typeActual "

Since I have just three types, I did an order by and I identified each type by column (x, y).
 

Users who are viewing this thread

Back
Top Bottom