dlookup!

S

smason

hello i have the following txt box withis code

[ data required] [from this qry] [id from form] [id from
qry]
=DLookUp("[steps taken]","qry steps count","[employee id]=[employee id]")

what is wrong with this as it doesn't work!

Please help! or the puppy gets it!
 
D

Daniel Pineault

What is '[ data required] [from this qry] [id from form] [id from qry]'?

The DLookup should be like

DLookUp("[steps taken]","qry steps count","[employee id]=" & Me.[employee id])

As for '[ data required] [from this qry] [id from form] [id from qry]'
Try something like one of the following

Me.id_from_qry

Or

Forms![ data required]![from this qry]![id from form].Form.[id from qry]
 
D

Douglas J. Steele

Since there are spaces in the name qry steps count, you need square brackets
around it.

Where are you getting employee id from? Presumably the first one in
"[employee id]=[employee id]" refers to a field in the query, but what is
the second one supposed to be? As that stands, you'll be comparing a field
to itself.
 
S

smason

Sorry the data in brackets was indicating what i thought was the data and
sequence needed in case it was wrong! any way thanks for the response! all
solved!
 
Top