• DLookup results included within a text string (97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » DLookup results included within a text string (97)

    Author
    Topic
    #476197

    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.

    Viewing 2 reply threads
    Author
    Replies
    • #1276827

      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.

    • #1276829

      I attach a modified version of yesterday’s demo that incorporates a Dlookup.

    • #1276840

      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

    Viewing 2 reply threads
    Reply To: DLookup results included within a text string (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: