Connecting Tech Pros Worldwide Help | Site Map

DLookup in a datasheet form

Knud Rogilds
Guest
 
Posts: n/a
#1: Nov 12 '05
I have tried everything, what am I doing wrong?

I have a data entry form in datasheet view (for mass data entry). One of the
fields are SalesID, and I would like to use DLookup to populate an unbound
field next to it, just for information for the data entry person.

I use:
strFilter = "SalesRefID = " & Me!Salesid
Me!Salesnavn = DLookup("SalesName", "SalesIDs", strFilter)

This works fine, but it populates every record in the datasheet with the
same name. How do I address one explicit row in my datasheet?


Rick Brandt
Guest
 
Posts: n/a
#2: Nov 12 '05

re: DLookup in a datasheet form


"Knud Rogilds" <krogilds@hotmail.com> wrote in message
news:407ffc26$0$275$edfadb0f@dread11.news.tele.dk. ..[color=blue]
> I have tried everything, what am I doing wrong?
>
> I have a data entry form in datasheet view (for mass data entry). One of[/color]
the[color=blue]
> fields are SalesID, and I would like to use DLookup to populate an[/color]
unbound[color=blue]
> field next to it, just for information for the data entry person.
>
> I use:
> strFilter = "SalesRefID = " & Me!Salesid
> Me!Salesnavn = DLookup("SalesName", "SalesIDs", strFilter)
>
> This works fine, but it populates every record in the datasheet with the
> same name. How do I address one explicit row in my datasheet?[/color]

If you want it to be different "per-row" you cannot assign the value from
code. You need to put the DLookup expression directly into the
ControlSource of the unbound TextBox. Then each row will evaluate the
expression using the value of SalesID found on the same row.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



Closed Thread