A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help to correct this DLookUp



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2007, 02:22 PM posted to microsoft.public.access.queries
Marco
external usenet poster
 
Posts: 535
Default Help to correct this DLookUp

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 a 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

  #2  
Old May 16th, 2007, 02:33 PM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Help to correct this DLookUp

Marco wrote:
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 a 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).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #3  
Old May 16th, 2007, 02:59 PM posted to microsoft.public.access.queries
Marco
external usenet poster
 
Posts: 535
Default Help to correct this DLookUp

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" wrote:

Marco wrote:
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 a 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).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com



  #4  
Old May 16th, 2007, 03:22 PM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Help to correct this DLookUp

Marco wrote:
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])

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.