Results 1 to 3 of 3

Thread: DLookup

  1. #1
    Join Date
    Mar 2004
    Location
    Atlanta, GA
    Posts
    58

    Unanswered: DLookup

    I have a parent form named frmDeal and a listbox named lstLineItems. I have a command button under the listbox that when clicked opens up a form name frmlineitemdetails. On the frmlineitemdetails form i have a couple of unbound txtfields that is populated by a dlookup. When I click on the listbox it opens up frmlineitemdetails form with the correct information for that record except the unbound fields. So I created a function that lookups those values. How can I call the function when the user double clicks on the item in the listbox it populates the unbound fields. I have the following code on the form load event. When I add the function on the form load event it bombs out when it is a new record.

    Code:
    If me.txtInvID is not null then
         Lookup_unboundvalues
    Else
    End if
    this is causing a object required error 421..

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    try

    if not isnull(txtInvID) then


    (and the me. does no harm)


    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    You need to clarify this a bit more.

    First, you said that the command button under the list box opened the form.

    Then you said that clicking on the list box opened the form.

    I assume that you are SELECTING from the list box and CLICKING on the button and when the frmlineitemdetails opens you want the expressions in those those two text boxes to reference the SELECTED record from the list box of the first form.

    Is this correct ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •