Connecting Tech Pros Worldwide Help | Site Map

DLookup in a datasheet form

  #1  
Old November 12th, 2005, 10:23 PM
Knud Rogilds
Guest
 
Posts: n/a
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?


  #2  
Old November 12th, 2005, 10:23 PM
Rick Brandt
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox with Dlookup in Datasheet View jadixon answers 3 June 17th, 2007 11:15 PM
Linking two subforms in datasheet view? ppwlee@gmail.com answers 1 February 13th, 2007 01:35 PM
DLookup in a datasheet form Knud Rogilds answers 1 November 12th, 2005 10:50 PM
How to move to specific record in Datasheet? deko answers 5 November 12th, 2005 05:33 PM