I am trying to implement a DLookUp() as the control source in a text box and not having much success. The syntax I have is:
=DLookUp("[tbl Doc Sections]![SecText]", "[tbl Doc Sections]", "[form]![SectionsID-1] = [tbl Doc Sections]![SecNumber]")
The function returns a strange value that I initially thought was random but, now, I do not think so. I use this database to manage the preparation of a document. The scheme is to prepare a revision, circulate for review comments, make changes, circulate a new revision for review comments, make changes, etc. untiI I retire. It is a good plan but slow to make progress. What I wanted to achieve from this was to recall the text of the section and display it on the same form where I entered responses to the various comments. The other attraction for using this function was that the document text could not be changed (a plus since I am not the only one making responses to comments.
I have a table called tbl Doc Sections that contains the text of each section of the document is in a field named SecText (a memo field) and another field called SecNumber (a text field) that identifies the section. The comments on each section are in another table called, oddly enough, tbl Comments and another field named SectionsID-1, again to identify the section. I obtain this last value by means of a look-up from tbl Doc Sections in tbl Comments. I chose this approach to have one piece of data in one place and, since each section has several comments written about it, I wanted the list of section numbers to appear only once in the database.
When I open the form and go from one comment to the next by means of a command button, the wrong section name is returned for about the first half dozen changes, then the field goes blank (a null return?) for about the next 3-4 dozen comments, then another incorrect section name, and finally, null fields are returned to the end of the list. Anyone have any ideas? I feel like I am close to getting what I want but I clearly need help. Thanks.
=DLookUp("[tbl Doc Sections]![SecText]", "[tbl Doc Sections]", "[form]![SectionsID-1] = [tbl Doc Sections]![SecNumber]")
The function returns a strange value that I initially thought was random but, now, I do not think so. I use this database to manage the preparation of a document. The scheme is to prepare a revision, circulate for review comments, make changes, circulate a new revision for review comments, make changes, etc. untiI I retire. It is a good plan but slow to make progress. What I wanted to achieve from this was to recall the text of the section and display it on the same form where I entered responses to the various comments. The other attraction for using this function was that the document text could not be changed (a plus since I am not the only one making responses to comments.
I have a table called tbl Doc Sections that contains the text of each section of the document is in a field named SecText (a memo field) and another field called SecNumber (a text field) that identifies the section. The comments on each section are in another table called, oddly enough, tbl Comments and another field named SectionsID-1, again to identify the section. I obtain this last value by means of a look-up from tbl Doc Sections in tbl Comments. I chose this approach to have one piece of data in one place and, since each section has several comments written about it, I wanted the list of section numbers to appear only once in the database.
When I open the form and go from one comment to the next by means of a command button, the wrong section name is returned for about the first half dozen changes, then the field goes blank (a null return?) for about the next 3-4 dozen comments, then another incorrect section name, and finally, null fields are returned to the end of the list. Anyone have any ideas? I feel like I am close to getting what I want but I clearly need help. Thanks.