Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup results included within a text string (97)

    I am using a function that will insert a string of text at the current cursor position in a memo field; on a Form; when a specified key combination is pressed. The text string insertion works properly. As a part of the text string that gets inserted, I would also like to include the results of a DLookup Function, which will include specific information from the form. Have verified that the DLookup returns the correct values. Am having no success with the procedure involved to include the DLookup within the text string.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    I'm not sure I understand what you are trying to do with the DLookup - the DLookup() function is used to return a specific field in a table or query. It sounds like you are trying to get the value from a tex box on the form. Does that text box have a DLookup() as it's data source? If so you should be able to simply concatenate that to the text string - but you will need to use VBA to do that, and a macro to detect the predetermined key combination. Not sure that helps - if not post some additional details and we will do our best to help.
    Wendell

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I attach a modified version of yesterday's demo that incorporates a Dlookup.
    Attached Files Attached Files
    Regards
    John



  4. #4
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your sample helped to show the proper convention of defining strings in combination with and correct use of the & and DLookup (that was my major snag). The insert at cursor now works exactly as I had envisioned. For me, a picture is worth a thousand words. Thank you very much for your help.

    Ron

Posting Permissions

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