DlookUp

A

Alex H

Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]=" &
[Student])

I am getting an error when running this - is there anyway I can see why I am
getting the error

Cheers
A
 
A

Alex H

I just get an #error on the control when I preview the report. However the
same code works in a form elsewhere


Ken Snell said:
What is the error?

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]="
& [Student])

I am getting an error when running this - is there anyway I can see why I
am getting the error

Cheers
A
 
K

Ken Snell [MVP]

Is Student a text field? If yes, try this (value is delimited with '
character):

=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]='" &
[Student] & "'")

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
I just get an #error on the control when I preview the report. However the
same code works in a form elsewhere


Ken Snell said:
What is the error?

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another
query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]="
& [Student])

I am getting an error when running this - is there anyway I can see why
I am getting the error

Cheers
A
 
A

Alex H

No,but you triggered a thought process which sorted the issue - many thanks

A

Ken Snell said:
Is Student a text field? If yes, try this (value is delimited with '
character):

=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]='"
& [Student] & "'")

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
I just get an #error on the control when I preview the report. However the
same code works in a form elsewhere


Ken Snell said:
What is the error?

--

Ken Snell
<MS ACCESS MVP>

Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another
query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]=" & [Student])

I am getting an error when running this - is there anyway I can see why
I am getting the error

Cheers
A
 
K

Ken Snell [MVP]

Don't keep us guessing.... we all learn from these posts. Please do tell us
what resolved the issue so that I and others will know to watch for this
situation.

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
No,but you triggered a thought process which sorted the issue - many
thanks

A

Ken Snell said:
Is Student a text field? If yes, try this (value is delimited with '
character):

=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and [Student]='"
& [Student] & "'")

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
I just get an #error on the control when I preview the report. However
the same code works in a form elsewhere


What is the error?

--

Ken Snell
<MS ACCESS MVP>

Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another
query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]=" & [Student])

I am getting an error when running this - is there anyway I can see
why I am getting the error

Cheers
A
 
S

SJ

Sorry, didn't realise...

It was essentially a lack of consistency in my naming conventions on my
part. Many moons ago i had created an object that I was using, which I did
not name according to conventions I now use, and had forgotten. The first
[Student] was a numeric field created as an expression, but needed to be
compared against [StudentId], the actual field name.

A





Ken Snell said:
Don't keep us guessing.... we all learn from these posts. Please do tell
us what resolved the issue so that I and others will know to watch for
this situation.

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
No,but you triggered a thought process which sorted the issue - many
thanks

A

Ken Snell said:
Is Student a text field? If yes, try this (value is delimited with '
character):

=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]='" & [Student] & "'")

--

Ken Snell
<MS ACCESS MVP>

I just get an #error on the control when I preview the report. However
the same code works in a form elsewhere


What is the error?

--

Ken Snell
<MS ACCESS MVP>

Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another
query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]=" & [Student])

I am getting an error when running this - is there anyway I can see
why I am getting the error

Cheers
A
 
K

Ken Snell [MVP]

Thanks for letting us know! ;-)

--

Ken Snell
<MS ACCESS MVP>

SJ said:
Sorry, didn't realise...

It was essentially a lack of consistency in my naming conventions on my
part. Many moons ago i had created an object that I was using, which I
did not name according to conventions I now use, and had forgotten. The
first [Student] was a numeric field created as an expression, but needed
to be compared against [StudentId], the actual field name.

A





Ken Snell said:
Don't keep us guessing.... we all learn from these posts. Please do tell
us what resolved the issue so that I and others will know to watch for
this situation.

--

Ken Snell
<MS ACCESS MVP>

Alex H said:
No,but you triggered a thought process which sorted the issue - many
thanks

A

Is Student a text field? If yes, try this (value is delimited with '
character):

=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]='" & [Student] & "'")

--

Ken Snell
<MS ACCESS MVP>

I just get an #error on the control when I preview the report. However
the same code works in a form elsewhere


What is the error?

--

Ken Snell
<MS ACCESS MVP>

Hi I am creating a report based on query "a" and all is working Ok.

I would like to add a control that uses a dlookup based on another
query:
=DLookUp("[Average]","qryGetPersonalGoalInfo","[Level]=0 and
[Student]=" & [Student])

I am getting an error when running this - is there anyway I can see
why I am getting the error

Cheers
A
 

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

Similar Threads


Top