Using a loop to fill Word forms using Access VBA -
I'm using a code to open the Word document using the access code and then fill out the form field .
I feel there is no problem with the code, but I want to change it so that the text box takes multiple IDs (one ID in each line) and displays the remaining code on each code, I split and others Looking for stuff, I have searched but I have no success.
I tried to add code so that after saving this field it can automatically save the form, will it work with many IDs?
Here is the entry I am using ATM:
In the form of a slow app word word. Apps as the Dyke Doc Word Restart the error on the document Resume Err.Clear Set AppWord = GetObject (, "Word.Application") if Err.Number & lt; & Gt; 0 then set AppWord = New Word.Application End if set Doctor = appWord.Documents.Open ("C: \ users \" & Environ $ ("username") & amp; "\ Desktop \ Form.doc", , True) with doctor .formfield ("text4"). Results = DLookup ("[name]", "[que]", "[qu]! [Id] =" & [id2]) appWord.Visible = True .Activate End Set Doc = None Set With App - Word = Nothing goes out all errHandler: MsgBox Err.Number & amp; ":" & amp; Err.Description End sub Edit: iigot Split (ID2.Value, ",") to work. However, after every new line I tried to make it split value but I still do not know.
I tried the environment. New line, vbCrLf, vbCr, vbNewLine and vbLf none of them worked
split (ID2.Value, vbCrLf) Good job! After that you can call the stars using X (0), pre (1) etc.
Comments
Post a Comment