DLookUp I've been looking at to long

A

amsFrederick

I am trying to bring meter readings from the last day of
the week to start fields in the next week. this is copying
4 numbers from a previous record to a new one in the same
database.

I created a query [Change Machine Meter Forwarding] which
returns the four numbers. I then try via the statement
below to copy them one at a time(Mon $1 Meter)to the
(Start $1)haveing the statment make sure the change
machine numbers are Identical



[Forms]![Change Machine Form - Tue Start]![Start $1]
DLookUp("[Change Machine Meter Forwarding]![Mon $1
Meter]","Change Machine Meter Forwarding","[Change Machine
Meter Forwarding]![Machine] = [Change Machine Form - Tue
Start]![Machine]")


I am geting a "can't parse" error
I have similar statements all over the app that work but
this is the first time I am referenceing a query.

What's missing?

Thank you in advance for your time and talent on this
problem.

David Valentino
 
G

Gary Miller

Did you mean to say...

[Forms]![Change Machine Form - Tue Start]![Start $1] =
DLookUp(....

I didn't see an = sign anywhere.

Also, you may be flirting with some problems with all of the
$ - type characters in field names as these all have special
meanings to VB and Access.

Gary Miller
Sisters, OR

"(e-mail address removed)"
 
K

Ken Snell

If I'm understanding correctly, your syntax is wrong. You don't use the !
operator between the name of a query and the name of a field in the query,
you use a . operator. Try this:

DLookUp("[Change Machine Meter Forwarding].[Mon $1
Meter]","Change Machine Meter Forwarding","[Change Machine
Meter Forwarding].[Machine] = [Change Machine Form - Tue
Start].[Machine]")
 

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