pass form field reference into variable - InfoPath Dev
in

InfoPath Dev

pass form field reference into variable

Last post 12-16-2011 12:12 PM by s2cawade. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-16-2011 12:12 PM

    pass form field reference into variable

    Hello, I'm new to programming infopath solutions.  I have a form field that (by formula) builds a network directory path. I have a button and OnClick event that should take the string value of the directory path field, create the directory and then open it so the user can drag and drop supporting documents to the new folder.  The string path is maintainded (along with all other fields) in an access database so that another group can review the documents.  I have started on the code behind the button but am very new to Infopath.  Any advice would be helpful but I need help understanding how to pass the form field as string value into my createobject and then open the created file path (was thinking about a do command for this part)?

    Sub CTRL113_7_OnClick(eventObj)
    var oField1 = eventObj.Source.selectSingleNode("my:@File_Path3");
     oField1.text = strFolder;
     
    set objFSO = createobject("Scripting.FileSystemObject")

    if objFSO.FolderExists(strFolder) = False then
     objFSO.CreateFolder strFolder
     MsgBox("Folder was created")
    else
     MsgBox("Folder was not created")
    end if
    End Sub

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.