Help to correct this DLookUp

M

Marco

Can you check what wrong with this DLOOKUp that I want o insert on a report.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber] = '" & [Employeenumber] & "' and [DataMarcacao]= '" & [DataMarcacao] & "'")

I have a report base on a querie. and I need to lookup for a value in
another querie.

There field that I want to retrieve is Hora_Ok and is on querie named:
7_cons_Entradas_Saidas_Renwin_Saldo

The criteria are: DataMarcacao must be equal of datamarcacao of the report
and employeenumber equal of EmployeeNumber of the report.

What's wrong with my DLOOKUP?

Best Regards,
Marco
 
R

Rick Brandt

Marco said:
Can you check what wrong with this DLOOKUp that I want o insert on a
report.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber]
= '" & [Employeenumber] & "' and [DataMarcacao]= '" & [DataMarcacao]
& "'")

I have a report base on a querie. and I need to lookup for a value in
another querie.

There field that I want to retrieve is Hora_Ok and is on querie named:
7_cons_Entradas_Saidas_Renwin_Saldo

The criteria are: DataMarcacao must be equal of datamarcacao of the
report
and employeenumber equal of EmployeeNumber of the report.

What's wrong with my DLOOKUP?

Best Regards,
Marco

Are both fields [Employeenumber] and [DataMarcacao] text fields? The single
quotes you have around them are appropriate if they are Text, but not if
they are numeric or date/times.

I would also recommend using Me![Employeenumber] and Me![DataMarcacao] for
the values from the report. The "Me" designator is not always necessary,
but more things can go wrong without it than with it. Also, does your
report have controls bound to those fields? Reports (for some reason)
cannot refer to fields in their Recordset unless they are actually used by a
control somewhere (even a hidden one).
 
M

Marco

Hi Rick. Thanks for your time. thanks.

EmployeeNumber and DataMarcacao is the same name for querie column name and
report.

Now I have this Dlookup but still returns error.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber]
= me!" & [Employeenumber] & " and [DataMarcacao]= me!" & [DataMarcacao] & ")")

Regards,
Marco




Rick Brandt said:
Marco said:
Can you check what wrong with this DLOOKUp that I want o insert on a
report.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber]
= '" & [Employeenumber] & "' and [DataMarcacao]= '" & [DataMarcacao]
& "'")

I have a report base on a querie. and I need to lookup for a value in
another querie.

There field that I want to retrieve is Hora_Ok and is on querie named:
7_cons_Entradas_Saidas_Renwin_Saldo

The criteria are: DataMarcacao must be equal of datamarcacao of the
report
and employeenumber equal of EmployeeNumber of the report.

What's wrong with my DLOOKUP?

Best Regards,
Marco

Are both fields [Employeenumber] and [DataMarcacao] text fields? The single
quotes you have around them are appropriate if they are Text, but not if
they are numeric or date/times.

I would also recommend using Me![Employeenumber] and Me![DataMarcacao] for
the values from the report. The "Me" designator is not always necessary,
but more things can go wrong without it than with it. Also, does your
report have controls bound to those fields? Reports (for some reason)
cannot refer to fields in their Recordset unless they are actually used by a
control somewhere (even a hidden one).
 
R

Rick Brandt

Marco said:
Hi Rick. Thanks for your time. thanks.

EmployeeNumber and DataMarcacao is the same name for querie column
name and report.

Now I have this Dlookup but still returns error.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber]
= me!" & [Employeenumber] & " and [DataMarcacao]= me!" &
[DataMarcacao] & ")")

The "Me!" goes outside the quotes.

=DLookUp("[Hora_Ok]";"[7_cons_Entradas_Saidas_Renwin_Saldo]";"[Employeenumber]
= " & Me![Employeenumber] & " and [DataMarcacao]= " &
Me![DataMarcacao])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top