Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2013

    Question Unanswered: DLookup question

    Hello all,

    The following might want to make most of you hang your head in a way that says "Oh my god..."


    I have a form, named RetentionForm1 and a few tables; ConsultantT, CustomerListT, RetentionTactic, SegmentT and StatsT.

    In my form (that will be used by consultants) is that I have a few fields, and at least one of them "OSAAccountNo" I would like to act as a search query.
    One would enter in an account number here, and in two fields below it would display data from CustomerListT about what RetentionTactic is associated with that account number, and what ID number is associated with that account no.

    In a nut shell, I want to be able to search an account number, and have details from CustomerListT be displayed in the blow fields.


  2. #2
    Join Date
    Nov 2011
    So just use a combobox as a lookup and use the wizard if you can't do it manually!


  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    you coudl, as Burrina suggests 'stuff' all that data in a combo box (but not display it in the combo box. then when a uysers selects the item from the combo you can extract the required data from (IIRC) the .selected property and the relevant .column.

    open a recordset which retrieves the values you require from the relevant table
    Database.OpenRecordset Method (DAO)

    Burrin'as suggestionis quite elegant, however be ware that extracting such data means you are pulling a lot of data to fiull a combo bo and the hit rate may be quite low. (ie you pull a lot of data and use very little of that data. if you have performance problems then this sin't neccesarily a smart call. samll numbers of rows in the combo no problem.. but if you start getting into the multi hundred, or thousand then it can be an issue. also its not suitable to volatile data (ie the values in the combo box will be those at the time the form was loaded, and not reflect any changes made to that data since.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2013
    HeraldM is quite right re the number of rows in the combo can be slow if too many are accessed, however the rows when volatile can be seen in the combo box by merely requerying the combo box in say the OnEntry or OnGotFocus event of the combo box
    Last edited by PatT; 11-07-13 at 07:06. Reason: correction

Tags for this Thread

Posting Permissions

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